Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print::printFloat should print "inf" when appropriate [imported] #961

Closed
cmaglie opened this issue Nov 15, 2012 · 0 comments

Comments

@cmaglie
Copy link
Member

commented Nov 15, 2012

This is Issue 961 moved from a Google Code project.
Added by 2012-06-22T11:11:33.000Z by n...@gammon.com.au.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).

Original labels: Type-Defect, Priority-Medium, Milestone-1.0.2, Component-Core

Original description

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");

@cmaglie cmaglie closed this Nov 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.