Issue with STR and FLOAT

Topics stay open unless there is a compelling reason to close them.

Be warned that an Arduino 'float' will only hold 6.8 significant digits. If you successfully convert 7023833275277351321 to a float you will end up with 7023833xxxxxxxxxxxx.0 (where 'x' is a digit that is probably not correct). If you're not lucky, that last '3' will also be wrong.

An AVR based Arduino...

I would prefer "32 bit floats", it's a matter of the float size, not of the Arduino type.
So it will be the same on an ESP32, unless you use double, which works on an ESP32,
but is not hardware backed, so it will be quite slow.

Some CPUs cast a float to a double for processing because the FPU works with doubles. In those cases the float type is provided just for more compact storage. I am new to the ESP32, and I spent some time looking at the data sheet and the core files, but couldn't find the details there. It's just that there is a lot of stuff to go through for one fact.

I learned that from following a "I use float in the ISR and the CPU panics" thread.

Crash in timer interupt when data type "float" is used

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.