Re: [PATCHES] [BUGS] BUG #2846: inconsistent and

From: Brian Hurt <bhurt(at)janestcapital(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] [BUGS] BUG #2846: inconsistent and
Date: 2006-12-29 15:45:04
Message-ID: 45953800.90004@janestcapital.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:

>Tom Lane wrote:
>
>
>>Bruce Momjian <bruce(at)momjian(dot)us> writes:
>>
>>
>>>Tom Lane wrote:
>>>
>>>
>>>>This is *not* going in the right direction :-(
>>>>
>>>>
>>>Well, then show me what direction you think is better.
>>>
>>>
>>Fewer restrictions, not more. The thrust of what I've been saying
>>(and I think Roman too) is to trust in the hardware float-arithmetic
>>implementation to be right. Every time you add an additional "error
>>check" you are going in the wrong direction.
>>
>>
>
>OK, are you saying that there is a signal we are ignoring for
>overflow/underflow, or that we should just silently overflow/underflow
>and not throw an error?
>
>
>
My understanding is that you have to actually set flags in the floating
point environment to make overflows, underflows, infinities, NaNs, etc.
raise signals. You might take a look at fenv.h (defined in the C99
spec) for the functions to do this. My apologies if I'm recovering well
trod ground here.

Note that taking a signal on an FP exception is a horribly expensive
proposition- we're talking about hundreds or thousands of clock cycles
here. But it's probably worthwhile vr.s the cost of testing every
floating point result, as generally FP exceptions will be rare (probably
even more rare in database work than in general). So it's probably
worthwhile.

Brian

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-12-29 15:49:55 Re: Dead Space Map for vacuum
Previous Message Edwin S. Ramirez 2006-12-29 15:43:17 Re: WITH Support

Browse pgsql-patches by date

  From Date Subject
Next Message Florian G. Pflug 2006-12-29 15:52:24 Re: [HACKERS] [BUGS] BUG #2846: inconsistent and
Previous Message Tom Lane 2006-12-29 15:33:30 Re: [HACKERS] [BUGS] BUG #2846: inconsistent and