Re: BUG #3677: ceil/floor not working as expected

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Aleksander Machniak <alec(at)alec(dot)pl>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3677: ceil/floor not working as expected
Date: 2007-10-15 14:00:16
Message-ID: 47137270.3060103@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Aleksander Machniak wrote:
> ceil(0.4) != ceil(4/10)
>
> It's confusing. Ceil(4/10::numeric) is ok, but in mysql I don't need keep
> casting in mind in this case.

The underlying issue is that integer divided by an integer yields an
integer, so 4/10 = 0.

No, it's not going to be changed in PostgreSQL. You can also write "4.0/10".

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Kuhner 2007-10-15 15:09:27 IPv6 Support in 8.0.3
Previous Message Doug Bedell 2007-10-15 13:53:26 BUG #3678: Folder Windows Don't Open Properly