Can Arduino Zero do true double size variables

Hello,

I am interested in the new Arduino Zero but want know if it can do true double precision variables. I know with the AVR MCUs doubles were mapped to floats. I am guessing since the Zero uses an ARM based chip the SAM D21 it can do double precision, but I want to be sure. Can anybody help confirm this or tell me where to look to find out. I tried the data sheet for the SAM D21 with no luck.

Thanks

There is no hardware floating point, but ZERO (like DUE) does support double. I ran the test test code
described here

In Wikipedia the "Double-precision floating-point format" article describes how 64-bit floating point numbers consist of a sign bit, 11-bit exponent and 52-bit mantissa. This has a bit precision of 53, giving you 53*log(2) = 15.9 decimal digits after the decimal point.

An example they give is that smallest number greater than one (in "sign | exponent | mantissa" format) as being: 0x3ff0 0000 0000 0001. This gives a value of 1.0000000000000002. Note that it's accurate to 15 decimal places and almost 16.

This can be tested on the Zero using the simple program below:

// Test: set the double to the smallest number greater than 1
union
{
  double d;                   // double
  struct 
  {
    uint64_t mantissa : 52;   // 52 bit mantissa
    uint64_t exponent : 11;   // 11 bit exponent
    uint64_t sign : 1;        // 1 bit sign
  } part;
} doubleFloat;

void setup() 
{
  Serial.begin(115200);
 
  doubleFloat.part.mantissa = 0x1;      // Load mantissa
  doubleFloat.part.exponent = 0x3FF;    // Load exponent
  doubleFloat.part.sign = 0x0;          // Load sign
  Serial.print(F("Double: "));
  Serial.println(doubleFloat.d, 16);    // Should output: 1.0000000000000002
}

void loop() {}

The answer returned from the Zero is 1.0000000000000002, therefore the SAMD21 does support double precision.