Float Infinity - Mailing list pgsql-general

From Kaloyan Iliev
Subject Float Infinity
Date
Msg-id 4587F5B0.7030908@faith.digsys.bg
Whole thread Raw
List pgsql-general
Hi All,

I just want to ask shouldn't substraction from infinity returns infinity
in float just like in timestamp?

This is for float:

a=# SELECT version();
                                            version
------------------------------------------------------------------------------------------------
 PostgreSQL 8.1.5 on i386-portbld-freebsd6.2, compiled by GCC cc (GCC)
3.4.6 [FreeBSD] 20060305
(1 row)

a=# SELECT 'Infinity'::float;
  float8
----------
 Infinity
(1 row)

a=# SELECT 'Infinity'::float-10;
ERROR:  type "double precision" value out of range: overflow
a=# SELECT 'Infinity'::float+10;
ERROR:  type "double precision" value out of range: overflow
a=# SELECT 'Infinity'::float-10::float;
ERROR:  type "double precision" value out of range: overflow
a=# SELECT 'Infinity'::float+10::float;
ERROR:  type "double precision" value out of range: overflow

And this is for timestamp:

a=# SELECT 'Infinity'::timestamp;
 timestamp
-----------
 infinity
(1 row)

a=# SELECT 'Infinity'::timestamp-'10 days'::interval;;
 ?column?
----------
 infinity
(1 row)

Regards,
   Kaloyan


pgsql-general by date:

Previous
From: "Jeff Amiel"
Date:
Subject: MAGIC_MODULE and libc
Next
From: Alvaro Herrera
Date:
Subject: Re: MAGIC_MODULE and libc