Re: BUG #3677: ceil/floor not working as expected - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #3677: ceil/floor not working as expected
Date
Msg-id 47137270.3060103@enterprisedb.com
Whole thread Raw
In response to BUG #3677: ceil/floor not working as expected  ("Aleksander Machniak" <alec@alec.pl>)
List 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

pgsql-bugs by date:

Previous
From: "Aleksander Machniak"
Date:
Subject: BUG #3677: ceil/floor not working as expected
Next
From: "Doug Bedell"
Date:
Subject: BUG #3678: Folder Windows Don't Open Properly