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 2ef2f9d5c7
commit e77ee2903b
1 changed files with 2 additions and 0 deletions

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)