We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi apparently, float multiplication have some problem with some value... just try this:
void setup() {
for (int i = 0; i < 100; i++) {
println(i*.1);
}
}
the result is
0.0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.90000004
1.0
1.1
1.2
1.3000001
1.4
1.5
1.6
1.7
1.8000001
1.9
2.0
2.1000001
2.2
2.3
2.4
2.5
2.6000001
2.7
2.8
2.9
3.0
3.1000001
3.2
3.3
3.4
3.5
3.6000001
3.7
3.8
3.9
4.0
4.1
4.2000003
4.3
4.4
4.5
4.6
4.7000003
4.8
4.9
this is amazing !!!!!!
Answers
https://Processing.org/reference/float.html
https://forum.Pprocessing.org/two/discussions/tagged/float
this is awful !!!!
you are easily amused.
how would you write 1/3 as a decimal? this is just the same thing but in binary.
For printing, you can use nf() to get rid of those excess zeros:
https://processing.org/reference/nf_.html