I am calculating the current height of a spindle motor and then displaying it. The height ranges from "200.999" to "000.001" but I am not sure how to store these values. The float variable can't seem to store anything above 1 digit in the ones column.
I am calculating the current height of a spindle motor and then displaying it. The height ranges from "200.999" to "000.001" but I am not sure how to store these values. The float variable can't seem to store anything above 1 digit in the ones column.
Does anyone know how I can store these values?
Thanks very much,
Zeb
??
Can you illustrate what you mean by the bolded part? Got a code example?
The Arduino website is not completely correct, because it shows eight significant digits. You can plan on six, and often the seventh will also be correct.
Have a read of Scientific notation, which I hope will clarify what 3.4028235E+38 means. It does not mean there can only be one digit to the left of the decimal point.
I thought that it meant you could only have one digit to the left of the decimal point, but it seems I have misunderstood it?
Thanks very much, Zeb
You have completely misunderstood it. Also this doesn't pass a reality check. Imagine how the hundreds of thousands of Arduino programs that print decimal numbers would be impacted by such a limitation - not possible. Also a simple self written test sketch would give you an answer (and some good programming practice). You didn't even try.
jremington:
The Arduino website is not completely correct, because it shows eight significant digits. You can plan on six, and often the seventh will also be correct.