Objective-C Float / Double precision?

This relates to precision, and this answer should clear things up.

You are correct in that this relates to precision, but as far as I can tell, I am comparing a double (234.32) to another double with the same value (234.32). Even though both of these aren't equal to 234.32, they should both have the same double representation. – FreeAsInBeer Mar 23 '11 at 16:51 @Bishop: So you're saying that if I instantiate two doubles with the same value that I cannot be sure they will be equal?

– FreeAsInBeer Mar 23 '11 at 17:04 Thanks for your time. – FreeAsInBeer Mar 23 '11 at 17:32 I stand corrected as to differing results with FPUs, I must have been thinking about epsilon() (see here) with respect to floating-point comparisons and have deleted the comment. Sorry for the confusion!

– Matt Bishop Mar 23 '11 at 18:32.

Solved! Turns out my framework method +(void)setDouble:(double)value forKey:(NSString*)key was actually defined as +(void)setDouble:(float)value forKey:(NSString*)key. The value passed was a double but was converted to a float for use in the method.

A simple copy and paste issue. Too bad the Objective-C compiler didn't at least throw up a warning like it seems to do for everything else...

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions