round() returning NaN
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