Skip to content

Commit 308d907

Browse files
committed
Printing NaN values as "nan" in printFloat().
http://code.google.com/p/arduino/issues/detail?id=946
1 parent a9fedab commit 308d907

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

hardware/arduino/cores/arduino/Print.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,8 @@ size_t Print::printFloat(double number, uint8_t digits)
226226
{
227227
size_t n = 0;
228228

229+
if (isnan(number)) return print("nan");
230+
229231
// Handle negative numbers
230232
if (number < 0.0)
231233
{

0 commit comments

Comments
 (0)