I will install and test with the 1.8.4 version of the IDE
I use windows, which platform do you use?
Still I need an example from you that is failing for 1.8.4 and not in an earlier version
After zeroing the filler with this line dbl.p.filler = 0;
I tried 1.8.1 1.8.4 and 1.8.5 and they gave me all the same output
Although a working testsketch is no guarantee of absense of bugs I cannot reproduce a failure yet.
When this problem is understood I will update code and testsketch on github.
//
// FILE: float2double.ino
// AUTHOR: Rob Tillaart
// VERSION: 0.1.00
// PURPOSE: experimental expands a float in a IEEE 754 double to be printed to PC.
//
// http://en.wikipedia.org/wiki/Double_precision
// http://en.wikipedia.org/wiki/Single-precision_floating-point_format
//
// Released to the public domain
//
#include <IEEE754tools.h>
byte x[8];
void setup()
{
Serial.begin(115200);
Serial.println();
for (float f = -50.0; f < 50.0; f += 10.0)
{
dumpFloat(f);
float2DoublePacked(f, x, LSBFIRST);
dumpByteArray(x);
float g = doublePacked2Float(x, LSBFIRST);
Serial.println(g, 20);
Serial.println();
}
dumpFloat(0.15625); // to check wikipedia
Serial.println("PI-check");
Serial.println(PI, 20);
float2DoublePacked(PI, x);
dumpByteArray(x);
float f = doublePacked2Float(x, LSBFIRST);
Serial.println(f, 20);
Serial.println("done");
}
void loop()
{
}
void dumpByteArray(byte *ar)
{
for (int i = 0; i < 8; i++)
{
Serial.print(ar[i], HEX);
Serial.print('\t');
}
Serial.println();
}