Re: [GD-General] ieee754 -0.0f?
Brought to you by:
vexxed72
From: Andras B. <and...@gm...> - 2006-02-01 18:26:21
|
Well, I've thought about that too, I'm running in debug mode, no optimizations and using improved floating point consistency (/Op). Still, -0.0f gives me 0x00000000.. On Wed, 01 Feb 2006 11:15:54 -0700, Ash Henstock <hen...@gm...> wrote: > Hi Andras, > > I suspect you've got "Fast" floating point model selected in VS project > options (check in C++->Code Generation I think). > Running your code here with Strict or Precise gives: > -0.000000 = 80000000 > but it falls down how you describe (00000000), with Fast selected. > > (Turion 64 MSVC8 here). > > Cheers. > > -- Ash. > > On 2/1/06, Andras Balogh <and...@gm...> wrote: >> >> > They are different, on an IEEE compliant system. >> >> Yeah, I know, that's why I'm surprised! :) >> >> > -0.0 = 0xbf800000 >> > +0.0 = 0x3f800000 >> >> These are -1.0f and +1.0f, but yeah, I've got the point. >> >> > You didn't mention the language or how you're generating those values. >> > Using VC6 on a Pentium-M by setting global floats I get the correct >> > and expected values. >> >> VS7.1 running on Athlon64, see source in previous post. >> >> >> thanks, >> >> >> >> Andras |