diff options
author | David A. Mellis <d.mellis@arduino.cc> | 2012-06-04 23:30:41 -0400 |
---|---|---|
committer | David A. Mellis <d.mellis@arduino.cc> | 2012-06-04 23:30:41 -0400 |
commit | 3436ca97cbccd9068c79bf201cb367de60789f37 (patch) | |
tree | 096846a2fe74930d44b1c5282fd5a9b0d0f09daa /cores/arduino/Print.cpp | |
parent | 57973bcd49f1b789232205528ec6ad0ea053c97d (diff) |
Printing NaN values as "nan" in printFloat().
http://code.google.com/p/arduino/issues/detail?id=946
Diffstat (limited to 'cores/arduino/Print.cpp')
-rwxr-xr-x | cores/arduino/Print.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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) { |