Export to GitHub

arduino - issue #961

Print::printFloat should print "inf" when appropriate


Posted on Jun 22, 2012 by Grumpy Panda

What steps will reproduce the problem? 1. Further to bug report 946 ... 2. Set a float to infinity (eg. 1.0/0.0 ) 3. Print it 4. See 0.00000000

What is the expected output? What do you see instead?

I expect to see "inf" but I see zero. Issue 946 now prints nan rather than zero (for 0.0/0.0), but I suggest that 1.0/0.0 should print "inf" and not zero.

What version of the Arduino software are you using? On what operating system? Which Arduino board are you using?

IDE 1.0.1 OS/X. Board not relevant.

Please provide any additional information below.

Suggest changing Print::printFloat to add, near the start:

if (isinf (number)) return print ("inf");

Status: Fixed

Labels:
Type-Defect Priority-Medium Milestone-1.0.2 Component-Core