Re: factorial of negative numbers - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: factorial of negative numbers
Date
Msg-id CAEZATCU3REOyN4OE1F4UWOEMj2ePNo9QR8a_tBf2V2j3sk8+ew@mail.gmail.com
Whole thread Raw
In response to Re: factorial of negative numbers  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: factorial of negative numbers  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
On Tue, 16 Jun 2020 at 12:18, Peter Eisentraut
<peter.eisentraut@2ndquadrant.com> wrote:
>
> On 2020-06-16 11:49, Dean Rasheed wrote:
> > With [1], we could return 'Infinity', which would be more correct from
> > a mathematical point of view, and might be preferable to erroring-out
> > in some contexts.
>
> But the limit of the gamma function is either negative or positive
> infinity, depending on from what side you come, so we can't just return
> one of those two.
>

Hmm yeah, although that's only really the case if you define it in
terms of continuous real input values.

I think you're probably right though. Raising an out-of-range error
seems like the best option.

Regards,
Dean



pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: TAP tests and symlinks on Windows
Next
From: Peter Eisentraut
Date:
Subject: Re: TAP tests and symlinks on Windows