Re: [GD-General] ieee754 -0.0f?
Brought to you by:
vexxed72
From: Brian H. <ho...@bo...> - 2006-02-01 17:49:15
|
On Wed, 01 Feb 2006 09:50:00 -0700, Andras Balogh wrote: > I know that -0.0f =3D=3D +0.0f is true, but the floating point > representation of the two numbers should be different, no? They are different, on an IEEE compliant system. IEEE-754 has the high bit reserved for sign, such that on a 32-bit system you would have: -0.0 =3D 0xbf800000 +0.0 =3D 0x3f800000 > Shouldn't the negative zero have the sign bit set? Well, on my > machine -0.0 and 0.0 are bitwise equal!! What's going on here? 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. Brian |