Float/Double cast to int - Mailing list pgsql-hackers

From Feng Tian
Subject Float/Double cast to int
Date
Msg-id CAFWGqns6Ko_amJYq8Sc=bnv20oNAru7M0R3PZbN_KihG4OJRUw@mail.gmail.com
Whole thread Raw
Responses Re: Float/Double cast to int  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi, Hackers,

Here is a query, server was built witch GCC on Linux, AMD64.


ftian=#
ftian=# select 1.5::int, 1.5::double precision::int, 314.5::int, 314.5::double precision::int;
 int4 | int4 | int4 | int4
------+------+------+------
    2 |    2 |  315 |  314
(1 row)


I believe this is because rint is broken -- can some expert on IEEE754 please help confirm that this is a bug?

Thanks,
Feng

pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint
Next
From: David Fetter
Date:
Subject: Re: GROUPING