• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
round() returning NaN
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

round() returning NaN


  • Subject: round() returning NaN
  • From: Eyal Redler <email@hidden>
  • Date: Fri, 01 Apr 2011 22:43:03 +0300

Hi,

What possible explanation could be for round() to return NaN when fed with a perfectly nice integral value? My program is consistently doing the following
1. I have class method that uses round()
2. The method is called once with the value 595 and gives the correct result
3. The method is called again with the same value, returning NaN (I can see the bad value in the debugger, immediately after returning from round())
Also:
4. The code belongs in a static library that is included in the main application
5. The number I'm feeding round with is actually a float and not a double, changing it to roundf() fixes the issue but I'm worrying this is a sign for some other trouble
6. I can see this every time I run the program with the same data
7. I wasn't able to reproduce this in another project
8. I recently changed many settings in my project - maybe there is some inconsistency between the settings of the main project to the subproject of the static library
9. I'm using Xcode 3.2.5

Thanks in advance,

Eyal Redler
------------------------------------------------------------------------------------------------
"If Uri Geller bends spoons with divine powers, then he's doing it the hard way."
--James Randi
www.eyalredler.com


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: round() returning NaN
      • From: "Frederick C. Lee" <email@hidden>
  • Prev by Date: Re: Xcode workflow
  • Next by Date: Re: How does XCode propagate build settings to sub projects (or does it at all?)
  • Previous by thread: Re: Xcode 3.2.6 keeps switching to iPad simulator
  • Next by thread: Re: round() returning NaN
  • Index(es):
    • Date
    • Thread