Tag Archives: floating point

Lean and Mean Float to String Conversion (ftoa)

Here is an often requested, basic float to ascii conversion function (ftoa). The typical method for arduino to perform this conversion is to use either of the dtostrf() or sprintf() functions. Both of these library functions incorporate the same underlying … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

Floating Point Precision and Binary 32 or, Arduino Don’t Know Math

Did you know? 0.1 + 0.2 = 0.30000001 Try this simple arduino program to prove it: First, don’t be alarmed, and second, don’t throw your arduino into the trash thinking it’s defective. Its working just fine. For comparison, performing this … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

A Note about GPS Precision and Floating Point Math

Do you suspect your GPS is not accurate enough? Maybe the GPS accuracy is not the fault, it could be the precision. And it might not be the precision of the GPS, it could be a floating point math issue. … Continue reading

Posted in Uncategorized | Tagged , , , , | Leave a comment

Continued Look at Fixed Point Math on the Arduino Platform

Continuing my overly simplified comparison of 24.8 fixed point vs. floating math on the AVR168/328 chip, I compared the elapsed time of the following two division operations running at 16Mhz: That’s nearly 1.8 times faster for the fixed-point math. If … Continue reading

Posted in Uncategorized | Tagged , , , , , | 3 Comments

Fixed Point Math on the Arduino Platform

Here is an overly simplified comparison of 24.8 fixed point vs. floating math on the AVR168/328 chip. I compared the elapsed time of the following two multiplications running at 16Mhz: That’s nearly 9.5 times faster. However, my comparison is not … Continue reading

Posted in Uncategorized | Tagged , , , , , | 11 Comments