Re: simple division

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: simple division
Date: 2018-12-04 21:51:31
Message-ID: 627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 12/4/18 2:36 PM, Martin Mueller wrote:
> It worked, and I must have done something wrong. I'm probably not the only person who would find something like the following helpful:
>
>
> division (integer division truncates the result) 10/3 3

The math types might take offense here, with the use of "truncates". 
Integer division really ask how many times can one subtract the
numerator from the denominator without going negative (or how many times
does the numerator "go into" the denominator).

It may seem a nuisance, but int division is a useful construct and must
be supported (and be the default). (If you have 10 people to transport
in cars which hold four (all can drive) 10/4 = 3 ;) )

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2018-12-04 21:59:45 Re: querying both text and non-text properties
Previous Message Thomas Kellerer 2018-12-04 21:38:48 Re: simple division