Re: Greatest Common Divisor - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Greatest Common Divisor
Date
Msg-id CAEZATCW282AQ0QwR-n+FSeyhyifvLZP9+p-iy_+8K-Nm1vCdNA@mail.gmail.com
Whole thread Raw
In response to Re: Greatest Common Divisor  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Responses Re: Greatest Common Divisor
Re: Greatest Common Divisor
List pgsql-hackers
Looking at the docs, I think it's worth going a little further than
just saying what the acronyms stand for -- especially since the
behaviour for zero inputs is an implementation choice (albeit the most
common one). I propose the following:

+       <entry>
+        greatest common divisor — the largest positive number that
+        divides both inputs with no remainder; returns <literal>0</literal> if
+        both inputs are zero
+       </entry>

and:

+       <entry>
+        least common multiple — the smallest strictly positive number
+        that is an integer multiple of both inputs; returns
<literal>0</literal>
+        if either input is zero
+       </entry>

(I have tried to be precise in my use of terms like "number" and
"integer", to cover the different cases)

Regards,
Dean



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Unicode normalization SQL functions
Next
From: "Daniel Verite"
Date:
Subject: Re: Making psql error out on output failures