BUG #4660: float functions return -0

Поиск
Список
Период
Сортировка
От ITAGAKI Takahiro
Тема BUG #4660: float functions return -0
Дата
Msg-id 200902161150.n1GBomsH036901@wwwmaster.postgresql.org
обсуждение исходный текст
Ответы Re: BUG #4660: float functions return -0
Список pgsql-bugs
The following bug has been logged online:

Bug reference:      4660
Logged by:          ITAGAKI Takahiro
Email address:      itagaki.takahiro@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)

В списке pgsql-bugs по дате отправления:

Предыдущее
От: toruvinn
Дата:
Сообщение: Re: BUG #4656: Indexes not used when comparing nextval() and currval() to integers
Следующее
От: "Thomas Waelde"
Дата:
Сообщение: BUG #4661: Installation