Re: [BUGS] BUG #2846: inconsistent and confusing handling of underflows, - Mailing list pgsql-patches

From Roman Kononov
Subject Re: [BUGS] BUG #2846: inconsistent and confusing handling of underflows,
Date
Msg-id 4592DAD8.1000400@xtremedatainc.com
Whole thread Raw
In response to Re: [BUGS] BUG #2846: inconsistent and confusing handling of  (Bruce Momjian <bruce@momjian.us>)
List pgsql-patches
On 12/27/2006 12:44 PM, Bruce Momjian wrote:
> The only unsolved issue is the one with underflow checks.  I have added
> comments explaining the problem in case someone ever figures out how to
> address it.

This will behave better for float4:

    Datum float4pl(PG_FUNCTION_ARGS)
    {
---    float4  arg1 = PG_GETARG_FLOAT4(0);
---    float4  arg2 = PG_GETARG_FLOAT4(1);
+++    double  arg1 = PG_GETARG_FLOAT4(0);
+++    double  arg2 = PG_GETARG_FLOAT4(1);
        double  result;

        result = arg1 + arg2;
        CheckFloat4Val(result,isinf(arg1) || isinf(arg2));
        PG_RETURN_FLOAT4((float4) result);
}

Roman

pgsql-patches by date:

Previous
From: Mason
Date:
Subject: Fwd: I would like to alter the COPY command
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Bundle of patches