1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-29 10:24:12 +01:00

Print "ovf" if float to be printed doesn't fit in a long.

http://code.google.com/p/arduino/issues/detail?id=967
This commit is contained in:
David A. Mellis 2012-06-28 23:20:56 -04:00
parent 1daeba6fd6
commit 6036846ce3

View File

@ -228,6 +228,8 @@ size_t Print::printFloat(double number, uint8_t digits)
if (isnan(number)) return print("nan");
if (isinf(number)) return print("inf");
if (number > 4294967040.0) return print ("ovf"); // constant determined empirically
if (number <-4294967040.0) return print ("ovf"); // constant determined empirically
// Handle negative numbers
if (number < 0.0)