| From: | Vik Fearing <vik(dot)fearing(at)2ndquadrant(dot)com> |
|---|---|
| To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Greatest Common Divisor |
| Date: | 2019-12-28 16:58:52 |
| Message-ID: | adbd3e0b-e3f1-5bbc-21db-03caf1cef0f7@2ndquadrant.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
I recently came across the need for a gcd function (actually I needed
lcm) and was surprised that we didn't have one.
So here one is, using the basic Euclidean algorithm. I made one for
smallint, integer, and bigint.
--
Vik Fearing +33 6 46 75 15 36
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support
| Attachment | Content-Type | Size |
|---|---|---|
| gcd.0001.patch | text/x-patch | 6.3 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Peter Eisentraut | 2019-12-28 17:05:28 | Re: ALTER TABLE support for dropping generation expression |
| Previous Message | David Fetter | 2019-12-28 16:45:30 | Re: Allow WHEN in INSTEAD OF triggers |