Skip to content

Commit d160a1b

Browse files
committed
Print "inf" for infinite floating point numbers (using isinf()).
http://code.google.com/p/arduino/issues/detail?id=961
1 parent 9018fbf commit d160a1b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

hardware/arduino/cores/arduino/Print.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ size_t Print::printFloat(double number, uint8_t digits)
227227
size_t n = 0;
228228

229229
if (isnan(number)) return print("nan");
230+
if (isinf(number)) return print("inf");
230231

231232
// Handle negative numbers
232233
if (number < 0.0)

0 commit comments

Comments
 (0)