Re: Greatest Common Divisor

From: Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Chapman Flack <chap(at)anastigmatix(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Greatest Common Divisor
Date: 2020-01-04 09:30:55
Message-ID: 4998d2c6-ba16-e6eb-df0c-e5fbf234d52d@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/01/2020 09:35, Fabien COELHO wrote:
>>> I'm unsure about gcd(INT_MIN, 0) should error. Possibly 0 would be
>>> nicer?
>>
>>
>> What justification for that do you have?
>
> ISTM that the current implementation has:
>
>   \forall int4 n, n \neq MIN_INT4, \gcd(n, 0) = 0 ?
>
> In which case applying the same rule for min int seems ok.

No, gcd(n, 0) = n.

--

Vik Fearing

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2020-01-04 09:34:10 Re: Greatest Common Divisor
Previous Message Fabien COELHO 2020-01-04 08:59:46 Re: Greatest Common Divisor