Problem with Float type variable
Problem with Float type variable
- Subject: Problem with Float type variable
- From: Adil Saleem <email@hidden>
- Date: Fri, 14 Aug 2009 23:46:02 -0700 (PDT)
Hi,
I am getting a strange error that i am unable to understand.
I have a float type variable for which i have defined the getter and setter methods. However, when i set its value from within my application, it changes the value and the setter method gets wrong value.
Example:
-(float)myvar
{
return myvar;
}
-(void)setMyvar:(float)aFloat
{
myvar = aFloat;
}
.....
[classObject setMyvar:863.6];
On calling this, the variable aFloat in setMyvar method gets value 863.599976. I also tried giving it 6.600000 but still didn't work correctly. I don't understand why is it changing the value. Why doesn't it get 863.6 ?
Thank You in advance
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden