Re: 0.99999998 (was: Unknown SQL)
Date: Sat, 21 Jul 2001 23:29:24 GMT
Message-ID: <kqqkht4i27n66t71tvcr03an4ei1dpu1a2_at_4ax.com>
On Sun, 3 Jun 2001 12:09:22 -0400, "Bob Badour" <bbadour_at_golden.net> wrote:
>>IEEE gets more complicated than that! In IEEE arithmetic, -0 and +0
>>are distinct values. So 1/-0 == -INF, 1/+0 == +INF. And yet -0 == +0
>>in all tests.
>>
>>I doubt many people will have problems with this particular thing in
>>conversion, but there is a more general point, that is that equality
>>is not as simple a test as it may first seem.
>
>The fact of the matter is: -0 does equal +0. I don't see what the problem
>is.
>
Now we digress!
Let x := -0. Let y := +0. Assume IEEE arithmetic. The following are
true.
- x and y are stored differently.
- If you test x == y, you get true.
- If you test 1/x == 1/y, you get false.
So in some cases it looks as though x "equals" y, and in others x "doesn't equal" y !
Although x == y, we need to be careful to preserve the stored value (and the sign) when copying them between platforms. Received on Sun Jul 22 2001 - 01:29:24 CEST