Re: Pure newbie :(
Re: Pure newbie :(
- Subject: Re: Pure newbie :(
- From: Brian Hannan <email@hidden>
- Date: Tue, 11 Nov 2003 19:59:14 -0800
You'll have the same types of problems with doubles as with floats. Be
just as careful doing strict equality tests and other comparisons.
Unless something drastic changed in the computing world, the only
difference between a float and a double is bit size. According to the
IEEE spec that governs their bitwise format, a double uses more bits,
and hence can have more precision and a larger/smaller exponent than a
float.
On Nov 11, 2003, at 11:53 AM, Mike R. Manzano wrote:
Just an addition; I was under the impression that it's not always safe
to compare two doubles as well...
On Nov 11, 2003, at 11:07 AM, Tony S. Wu wrote:
try using double.
never compare two floats.
Tony S. Wu
email@hidden
"The world doesn't give us hope - it gives us chance."
http://homepage.mac.com/tonyswu/tonyswu - My web page.
----------------------------------------------------------------------
--
-------
On Nov 11, 2003, at 10:45 AM, Denis Vaillant wrote:
Hello,
I do not understand why the comparison does not work :
rxNext1 = 0.400000;
if(rxNext1==0.400000)
{
NSLog(@"Should work :(");
}
PS : rxNext1 is a float.
Cheers,
Denis
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
Brian Hannan
Chief Admiral of Uncle Jam's Navy
"One nation under a groove, gettin' down just for the FUNK of it."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.