Re: simple division
От | Gavin Flower |
---|---|
Тема | Re: simple division |
Дата | |
Msg-id | d5a77ae7-5e41-57bd-c9a8-85b7c0b9f3e2@archidevsys.co.nz обсуждение исходный текст |
Ответ на | Re: simple division (Adrian Klaver <adrian.klaver@aklaver.com>) |
Ответы |
Re: simple division
|
Список | 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@archidevsys.co.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.
В списке pgsql-general по дате отправления: