Re: Greatest Common Divisor - Mailing list pgsql-hackers

From Vik Fearing
Subject Re: Greatest Common Divisor
Date
Msg-id 4998d2c6-ba16-e6eb-df0c-e5fbf234d52d@2ndquadrant.com
Whole thread Raw
In response to Re: Greatest Common Divisor  (Fabien COELHO <coelho@cri.ensmp.fr>)
List 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




pgsql-hackers by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: Greatest Common Divisor
Next
From: Fabien COELHO
Date:
Subject: Re: Greatest Common Divisor