From: | Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz> |
---|---|
To: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, Geoff Winkless <pgsqladmin(at)geoff(dot)dj>, pgsql-general(at)lists(dot)postgresql(dot)org |
Subject: | Re: simple division |
Date: | 2018-12-05 17:31:29 |
Message-ID: | d5a77ae7-5e41-57bd-c9a8-85b7c0b9f3e2@archidevsys.co.nz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
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(at)archidevsys(dot)co(dot)nz> 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.
From | Date | Subject | |
---|---|---|---|
Next Message | Alvaro Herrera | 2018-12-05 20:37:27 | Re: simple division |
Previous Message | Martin Mueller | 2018-12-05 15:53:08 | Re: simple division |