Float/Double cast to int

From: Feng Tian <ftian(at)vitessedata(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Float/Double cast to int
Date: 2015-05-21 18:29:02
Message-ID: CAFWGqns6Ko_amJYq8Sc=bnv20oNAru7M0R3PZbN_KihG4OJRUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2015-05-21 18:39:18 Re: GROUPING
Previous Message Peter Geoghegan 2015-05-21 18:25:50 Re: INSERT ... ON CONFLICT DO UPDATE with _any_ constraint