Re: Strange behavior of -Wfloat-equal on clang (Xcode 5)
Re: Strange behavior of -Wfloat-equal on clang (Xcode 5)
- Subject: Re: Strange behavior of -Wfloat-equal on clang (Xcode 5)
- From: Sean McBride <email@hidden>
- Date: Fri, 03 Jan 2014 14:23:09 -0500
- Organization: Rogue Research Inc.
On Fri, 3 Jan 2014 18:28:29 +0000, Asiga Nael said:
>First of all, I don't understand why a==2.1 triggers the warning and
>a==2.0 doesn't.
Then you need to read up on how floating point numbers are encoded... there is certainly much on the Internet about this.
Not every decimal number can be expressed exactly as a floating point number. You can see that here:
<http://www.h-schmidt.net/FloatConverter/>
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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