Manipulating IEEE754 32bit floats (incl mapping 64bit double)

robtillaart:

I think arduino needs a 64bit double to be fully implemented.

It is often asked for, but have seen no code yet...
There are not so much sensors that give more significant digits than a float can handle. Note that 6 significant digits means a dynamic range of a factor 100000.

Why do you need doubles?

Well the simple thing is switch to the Due (or Teensy 3.0 or DigiX) which uses an Arm processor, and supports 64-bits.

You are likely never to get 64-bit double support in AVR processors, since in order to get them, you need the compiler to first enable 64-bit doubles (right now, it is hardwired to 32-bit). Then you have to have multilib support in the library to support existing people with 32-bit doubles and with 64-bit doubles. Then the IDE would need to move up to the newest compiler (the current one is several years old) and offer a choice between 32-bit and 64-bit doubles.

This is all doable, but it needs cooperation between several different groups. Due to release timing, even if everybody decided it was needed, it likely wouldn't get it to users until late 2014, if not 2015. Will AVR still be attractive for new designs in 2015, or will the world have switched to Arm?

Also if you are using a small memory AVR like an ATtiny (digispark, trinket, etc.) going to 64-bit floating point may cause some programs not to load, since the floating point emulator for 64-bits is likely bigger than the 32-bit emulator.

So people that need to transport raw binary 64-bit floating point values, will probably continue to have to use functions like this library.