Re: Re: PostgreSQL needs percentage function

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Nick Dro <postgresql(at)walla(dot)co(dot)il>
Cc: Hubert Lubaczewski <depesz(at)depesz(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Re: PostgreSQL needs percentage function
Date: 2017-12-18 16:21:49
Message-ID: CAKFQuwYJrfuQHO28h9x9o=PfmZcYru7x1nXwC_LrzgQd+AbvYg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 18, 2017 at 9:13 AM, Nick Dro <postgresql(at)walla(dot)co(dot)il> wrote:

>
> Hi,
> I know how to implement this. It's not the issue.
> It's very easy to implement absolute value as well yet still PostgreSQL
> gives abs(x) function which is build in function.
> My claim is that if there is a build in function for absolute value why
> not for percentage? Both are very basic mathematical operations.
>
> Can you give a good reason why absolute value has a build in function
> while percentage is not?
>

Frankly, the name "percent​" is a poor choice: am I supposed to input two
number and it gives me the percentage that the first is of the second
(division) or, at you think here, I input a number and a percentage to
multiply them? And why is percent >1 as opposed to (generally) between 0
and 1?

abs(x) has only one input and so none of those questions apply to it.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2017-12-18 16:28:53 Re: PostgreSQL needs percentage function
Previous Message Pavel Stehule 2017-12-18 16:19:08 Re: Re: PostgreSQL needs percentage function