From 6036846ce311470845d8bb0e69b6dd3a5a86c0da Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Thu, 28 Jun 2012 23:20:56 -0400 Subject: [PATCH] Print "ovf" if float to be printed doesn't fit in a long. http://code.google.com/p/arduino/issues/detail?id=967 --- hardware/arduino/cores/arduino/Print.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hardware/arduino/cores/arduino/Print.cpp b/hardware/arduino/cores/arduino/Print.cpp index 711251c8a..53961ec47 100755 --- a/hardware/arduino/cores/arduino/Print.cpp +++ b/hardware/arduino/cores/arduino/Print.cpp @@ -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)