Hello,
I'm trying to send some double precision values over serial to a teensy/arduino and store it in EEPROM then read it back over serial. During my testing it seems that only float precision can be displayed, does this mean that the teensy cannot store double (64 bit floats) values in its EEPROM (I am aware that the arduino can only handle 32 bit floats)? Or is this instead a flaw with the String() function?
The output for each is as follows:
Many thanks
I'm trying to send some double precision values over serial to a teensy/arduino and store it in EEPROM then read it back over serial. During my testing it seems that only float precision can be displayed, does this mean that the teensy cannot store double (64 bit floats) values in its EEPROM (I am aware that the arduino can only handle 32 bit floats)? Or is this instead a flaw with the String() function?
Code:
void setup() {
Serial.begin(9600);
}
void loop() {
double number = 1.000001;
double number2 = 1.0000005;
Serial.println(String(number+ 2*number2,20));
}
The output for each is as follows:
Code:
Arduino Uno
16:24:23.349 -> 3.00000190000000000000
Teensy 4.0
3.00000190734863281250
Many thanks