Re: Fixing geometic calculation
От | marcin mank |
---|---|
Тема | Re: Fixing geometic calculation |
Дата | |
Msg-id | b1b9fac60908081941u30cdc5b9h23e500386d8f52b2@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Fixing geometic calculation (Paul Matthews <plm@netspace.net.au>) |
Ответы |
Re: Fixing geometic calculation
|
Список | pgsql-hackers |
On Sat, Aug 8, 2009 at 3:07 AM, Paul Matthews<plm@netspace.net.au> wrote: > IEEE754 does not allow two number X and Y, such that X!=Y and (X-Y)==0. > And since IEEE754 has been around since the 70's or 80's I think we can > start relying on its existence and behavior by now. > You are correct, I think, though this does not solve the division problem: $ cat t.c #include <stdio.h> int main(){ double a=1.000001e-307, b=1e-307, c=a-b; printf("a=%le, b=%le, c=%le, c==0:%d, a==b:%d 1/c=%le\n",a,b,c,c==0,a==b,1.0/c); return 0; } $ gcc -Wall -O2 t.c $ ./a.out a=1.000001e-307, b=1.000000e-307, c=1.000000e-313, c==0:0, a==b:0 1/c=inf Greetings Marcin Mańk
В списке pgsql-hackers по дате отправления: