From 3436ca97cbccd9068c79bf201cb367de60789f37 Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Mon, 4 Jun 2012 23:30:41 -0400 Subject: Printing NaN values as "nan" in printFloat(). http://code.google.com/p/arduino/issues/detail?id=946 --- cores/arduino/Print.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cores/arduino') diff --git a/cores/arduino/Print.cpp b/cores/arduino/Print.cpp index e541a6c..98969f5 100755 --- a/cores/arduino/Print.cpp +++ b/cores/arduino/Print.cpp @@ -226,6 +226,8 @@ size_t Print::printFloat(double number, uint8_t digits) { size_t n = 0; + if (isnan(number)) return print("nan"); + // Handle negative numbers if (number < 0.0) { -- cgit v1.2.3-18-g5258