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

Re: range value problem with double precision [PG 8.3.3]

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-bugs(at)postgresql(dot)org, khanzahid235(at)yahoo(dot)com
Subject: Re: range value problem with double precision [PG 8.3.3]
Date: 2008-08-22 12:43:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Zahid Khan wrote:
> Hi ,
>  I see one issue pg 8.3.3 .
> 1.
> According to the documentation of pg "The double precision type
> typically has a range of around 1E-307 to 1E+308 with a precision of at
> least 15 digits".
> ref:-
> but in PG8.3 the values less then minimum range are being inserted.
> e.g
> . on insertion of 1E-308 we should get an error of "out of range or
> underflow value" but this value is being accepted by server.

The operating words are "typically" and "around".  You can put in smaller and 
larger values, but then the precision is going to degrade, as you can observe 

peter=# select '1E-305'::float8;
(1 row)

peter=# select '1E-310'::float8;
(1 row)

peter=# select '1E-315'::float8;
(1 row)

peter=# select '1E-320'::float8;
(1 row)

peter=# select '1E-325'::float8;
ERROR:  22003: "1E-325" is out of range for type double precision
LOCATION:  float8in, float.c:426

The following, however, appears to be a bug:

peter=# select '1E-324'::float8;
ERROR:  22P02: invalid input syntax for type double precision: "1E-324"
LOCATION:  float8in, float.c:431

In response to


pgsql-bugs by date

Next:From: Bernard SteweDate: 2008-08-22 13:17:55
Subject: Installation Problems
Previous:From: Zahid KhanDate: 2008-08-22 11:38:33
Subject: range value problem with double precision [PG 8.3.3]

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