Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-bugs by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group