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

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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Roman Kononov <kononov195-pgsql(at)yahoo(dot)com>
Subject: Re: [HACKERS] [BUGS] BUG #2846: inconsistent and
Date: 2006-12-30 18:53:25
Message-ID: 200612301853.kBUIrQd11810@momjian.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)us> writes:
> > 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?
> 
> Silent underflow is fine with me; it's the norm in most all float
> implementations and won't surprise anyone.  For overflow I'm OK with
> either returning infinity or throwing an error --- but if an error,
> it should only be about inf-out-with-non-inf-in, not comparisons to any
> artificial MAX/MIN values.

OK, I am happy to remove the MIN/MAX comparisons.  Those were in the
original code.

The attached, updated patch creates a single CHECKFLOATVAL() macro that
does the overflow/underflow comparisons and throws an error.  This also
reduces the isinf() calls.  Should I be concerned we are now duplicating
the error text in all call sites?

Regression wording modified now that float4/float8 checks are merged.  I
haven't update the platform-specific float* expected files yet, but will
on commit.

-- 
  Bruce Momjian   bruce(at)momjian(dot)us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

Attachment: /pgpatches/float
Description: text/x-diff (39.7 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2006-12-30 19:05:12
Subject: Re: Logging temp file useage ... a little advice
Previous:From: Bruce MomjianDate: 2006-12-30 18:44:58
Subject: Re: TODO: GNU TLS

pgsql-patches by date

Next:From: Tom LaneDate: 2006-12-30 21:23:02
Subject: Re: [HACKERS] Bundle of patches
Previous:From: Jim C. NasbyDate: 2006-12-30 04:46:27
Subject: Re: column ordering, was Re: [PATCHES] Enums patch v2

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