The following bug has been logged online:

Bug reference:      4660
Logged by:          ITAGAKI Takahiro
Email address:      itagaki.takah...@oss.ntt.co.jp
PostgreSQL version: 8.3.3
Operating system:   Fedora 8
Description:        float functions return -0
Details: 

Float8 versions of trunc(), ceil() and round() could return -0 on some
version of glibc.

We avoid -0 in float8um (unary minus),
but should we add the same codes in those functions?
There is inconsistency compared with numeric version
of funcs and it is a platform-dependent behavior;
0 is returned there.

postgres=# SELECT pg_catalog.trunc((-0.1)::float8);
 trunc
-------
    -0
(1 row)

postgres=# SELECT pg_catalog.ceil((-0.1)::float8);
 ceil
------
   -0
(1 row)

postgres=# SELECT pg_catalog.round((-0.1)::float8);
 round
-------
    -0
(1 row)

postgres=# select version();
                                              version
----------------------------------------------------------------------------
------------------------
 PostgreSQL 8.3.3 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 4.1.1
20070105 (Red Hat 4.1.1-51)
(1 row)

-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to