Re: Possible GCC float comparison bug? Or am I doing it wrong?
Re: Possible GCC float comparison bug? Or am I doing it wrong?
- Subject: Re: Possible GCC float comparison bug? Or am I doing it wrong?
- From: Marshall Clow <email@hidden>
- Date: Tue, 19 Feb 2008 19:41:01 -0800
Title: Re: Possible GCC float comparison bug? Or am I
doing it wr
At 9:27 PM -0600 2/19/08, David Rogers wrote:
This may be completely obvious but I
can't tell what's going on. As far as I know the comparison
should be true. I've tried it with Xcode 3.0 on both Intel and
PPC and get the same results on both.
-0.001 is less than -0.1, right? Or
does the compiler see things differently? Here's a sample app to
illustrate the behavior that I'm seeing.
No, it's not.
0.001 is less than 0.1 but, -0.001 is _greater_ than -0.1
Put them on a number line if that helps:
-1
0 1
-inf
-----------|--------|-----|--|--|-----|--------|---------
+inf
-0.1 -0.001 0.001 0.1
--
-- Marshall
Marshall Clow Idio Software
<mailto:email@hidden>
It is by caffeine alone I set my mind in motion.
It is by the beans of Java that thoughts acquire speed,
the hands acquire shaking, the shaking becomes a warning.
It is by caffeine alone I set my mind in motion.
_______________________________________________
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