Alban Hertroys <[email protected]> writes:
> On 11 Oct 2011, at 2:55, Harvey, Allan AC wrote:
>> My simple understanding of trunc() and casting to an integer says that
>> there is a bug here.
> Which the type-cast should round to 4380103 and 4380104 respectively.
> It doesn't:
That's because a cast from float to int rounds, it doesn't truncate.
regression=# select (4.7::float8)::int;
int4
------
5
(1 row)
regards, tom lane
--
Sent via pgsql-general mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general