as a one week old arduino programmer i try to lean all the references on the Arduino website.
But I'm stuck at the reference about floating point constants. I find the explanation a bit minimal and don't understand the use from them besides that you can make other notations.
but for example how are they stored? as an int, a double...
what about decimal point because only floats can hold them
and can someone give me an example how they are used?
Arduino uses IEEE 754 floating point format. Note, the AVR gcc compiler only uses the 32-bit single precision format, so float and double share the same format. The ARM gcc compiler for the Due/teensy 3.0/mbed/beaglebone/Rasberry-Pi defines double as 64-bit IEEE 754. Here is the Wikipedia entry on IEEE 754: IEEE 754 - Wikipedia
Note, that none of the AVRs, nor the Due/Teensy 3.0 support floating point in hardware. All floating point is done by software emulation. Larger chips do support 32/64-bit in hardware (and occasionally 80 or 128-bit).
as a one week old arduino programmer i try to lean all the references on the Arduino website.
But I'm stuck at the reference about floating point constants. I find the explanation a bit minimal and don't understand the use from them besides that you can make other notations.
but for example how are they stored? as an int, a double...
what about decimal point because only floats can hold them
and can someone give me an example how they are used?
thanks in advance
best regards
jazzy
I am not entirely sure it you are talking about floating point literals (floating values written numerically in code)
or floating point variables that are declared "const"?
These days all processors store floating point values in IEEE format as mentioned previously, wikipedia
will have all the gory details if you want them.