Does processing know that when I type 6.673e-11 as a float it should come out 0.00000000006673 ?
Thanks.
Does processing know that when I type 6.673e-11 as a float it should come out 0.00000000006673 ?
Thanks.
Within β.pdeβ files, any literal w/ a dot .
or an e
in it is treated as a float
primitive datatype:
https://Processing.org/reference/float.html
If you wish for a double
instead, suffix them all w/ a d
: 6.673e-11d
https://Processing.org/reference/double.html
The best way to answer questions like this is to just put together a little example program that tests it out:
float x = 6.673e-11;
float y = 0.00000000006673;
println(x == y);
This prints out true
. But be mindful of floating point accuracy.