Search Postgresql Archives

Re: simple division

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/12/2018 02:32, Adrian Klaver wrote:
On 12/5/18 4:45 AM, Gavin Flower wrote:
On 06/12/2018 00:05, Geoff Winkless wrote:
On Wed, 5 Dec 2018 at 09:13, Gavin Flower <GavinFlower@xxxxxxxxxxxxxxxxx> wrote:
SELECT ceil(10/4.0);

Geoff

If you divide one integer by another, then it is logical to get an integer as as the answer.

Hmm, grab any of my calculators and divide 10/4 and get 2.5. Seems not everybody agrees with that logic:)


Calculators normally work in floating point (in fact, as far as I am aware, they never work in integer mode by default) , unless you are either doing symbolic maths or numbers that are integer based like hexadecimal.

So your example does not contrdict what I said.






[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux