Hi people!!
I’m getting mad trying to get some points with a lot of decimals…
Maybe this is a stupid question or I’m crazy… but I remember using lot of decimals, with float or double variable types (in java).
I’m using “big numbers” and when I want to get the last values of the decimal part, the value is changing… Better to show the code:
double[] iz = {458691.451154, 4462621.015578};
double a = 458691.451154;
float f = 458691.451154;
void setup(){
println("x1000: " +(iz[0]*1000)+" Double: "+iz[0]);
println(iz[0],iz[1]);
println(" \n THIS IS a: "+a);
println(" THIS IS f: "+f);
println(" THIS IS transformed a: "+((a-458690)*100));
println(" THIS IS transformed2 a: "+((a*100)-(458690*100)));
}
And this is the result:
x1000: 4.586914375E8 Double: 458691.4375
458691.4375 4462621.0
THIS IS a: 458691.4375
THIS IS f: 458691.44
THIS IS transformed a: 143.75
THIS IS transformed2 a: 143.75
Don’t know how to get that decimals that I’m losing or why I’m losing them… And why my number finishes with …1.451154 and the printed one finishes with …1.4375
Thanks