pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: simple division
Date: Tue, 4 Dec 2018 14:51:31 -0700
Message-ID: <627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com> (raw)
In-Reply-To: <1F5FCEFC-7DEA-46FA-9895-FBF7DFDEC750@northwestern.edu>
References: <4DEACFC2-E8E3-4C61-805B-56A5F76CB819@northwestern.edu>
	<dd63a926-6711-b795-6485-5029b9556213@commandprompt.com>
	<CAKFQuwZXO4WJqEbmWUtnCvDhRfVqYWbFx7bQ8D-Q-mxPRqEKgg@mail.gmail.com>
	<8B35EF9C-8DEF-4298-A646-89D1AC8F63E1@northwestern.edu>
	<CAKFQuwZ-OXBEXjLa0i_1SwyiiiEwMcfuhZyC3cpe2aKZRpcJag@mail.gmail.com>
	<1F5FCEFC-7DEA-46FA-9895-FBF7DFDEC750@northwestern.edu>


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 ;) )







view thread (25+ messages)  latest in thread

Message-ID: <627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com>
Permalink:  ../627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com/
Also on:    postgresql.org/message-id/627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com
  Subject: Re: simple division
  In-Reply-To: <627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com>
  References: <4DEACFC2-E8E3-4C61-805B-56A5F76CB819@northwestern.edu> <dd63a926-6711-b795-6485-5029b9556213@commandprompt.com> <CAKFQuwZXO4WJqEbmWUtnCvDhRfVqYWbFx7bQ8D-Q-mxPRqEKgg@mail.gmail.com> <8B35EF9C-8DEF-4298-A646-89D1AC8F63E1@northwestern.edu> <CAKFQuwZ-OXBEXjLa0i_1SwyiiiEwMcfuhZyC3cpe2aKZRpcJag@mail.gmail.com> <1F5FCEFC-7DEA-46FA-9895-FBF7DFDEC750@northwestern.edu> <627868ba-0d4b-8995-d29a-db6b7ca3673d@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox