pgsql: Try to be more consistent about accepting denormalized float8 nu

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Try to be more consistent about accepting denormalized float8 nu
Date: 2012-02-01 18:14:19
Message-ID: E1RsehH-0008A2-Vt@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Try to be more consistent about accepting denormalized float8 numbers.

On some platforms, strtod() reports ERANGE for a denormalized value (ie,
one that can be represented as distinct from zero, but is too small to have
full precision). On others, it doesn't. It seems better to try to accept
these values consistently, so add a test to see if the result value
indicates a true out-of-range condition. This should be okay per Single
Unix Spec. On machines where the underlying math isn't IEEE standard, the
behavior for such small numbers may not be very consistent, but then it
wouldn't be anyway.

Marti Raudsepp, after a proposal by Jeroen Vermeulen

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c318aeed84438619fc6b8c647def1730a110f04b

Modified Files
--------------
src/backend/utils/adt/float.c | 44 +++++++++++++++++++++++++++++++---------
1 files changed, 34 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2012-02-01 18:14:20 pgsql: Add some regression test cases for denormalized float8 input.
Previous Message Alvaro Herrera 2012-02-01 17:23:37 pgsql: Implement dry-run mode for pg_archivecleanup