Skip site navigation (1) Skip section navigation (2)

Re: [BUGS] BUG #2846: inconsistent and confusing handling of underflows,

From: Roman Kononov <roman(at)xtremedatainc(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>,PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #2846: inconsistent and confusing handling of underflows,
Date: 2006-12-27 20:43:04
Message-ID: 4592DAD8.1000400@xtremedatainc.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-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

In response to

Responses

pgsql-hackers by date

Next:From: markDate: 2006-12-27 20:44:36
Subject: Re: Bitmap index thoughts
Previous:From: Tom LaneDate: 2006-12-27 20:29:48
Subject: Re: Allow the identifier length to be increased via a configure option

pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-12-27 21:23:39
Subject: Re: [BUGS] BUG #2846: inconsistent and confusing handling of
Previous:From: Tom LaneDate: 2006-12-27 20:29:48
Subject: Re: Allow the identifier length to be increased via a configure option

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group