pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add functions gcd() and lcm() for integer and numeric types.
Date: Sat, 25 Jan 2020 14:05:15 +0000
Message-ID: <E1ivM3n-0004P4-LS@gemulon.postgresql.org> (raw)

Add functions gcd() and lcm() for integer and numeric types.

These compute the greatest common divisor and least common multiple of
a pair of numbers using the Euclidean algorithm.

Vik Fearing, reviewed by Fabien Coelho.

Discussion: https://postgr.es/m/adbd3e0b-e3f1-5bbc-21db-03caf1cef0f7@2ndquadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/13661ddd7eaec7e2809ff5c29fc14653b6161036

Modified Files
--------------
doc/src/sgml/func.sgml                |  34 +++++++
src/backend/utils/adt/int.c           | 126 +++++++++++++++++++++++++
src/backend/utils/adt/int8.c          | 126 +++++++++++++++++++++++++
src/backend/utils/adt/numeric.c       | 171 ++++++++++++++++++++++++++++++++++
src/include/catalog/catversion.h      |   2 +-
src/include/catalog/pg_proc.dat       |  20 ++++
src/test/regress/expected/int4.out    |  46 +++++++++
src/test/regress/expected/int8.out    |  46 +++++++++
src/test/regress/expected/numeric.out |  44 +++++++++
src/test/regress/sql/int4.sql         |  25 +++++
src/test/regress/sql/int8.sql         |  25 +++++
src/test/regress/sql/numeric.sql      |  25 +++++
12 files changed, 689 insertions(+), 1 deletion(-)



Message-ID: <E1ivM3n-0004P4-LS@gemulon.postgresql.org>
Permalink:  ../E1ivM3n-0004P4-LS@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ivM3n-0004P4-LS@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dean.a.rasheed@gmail.com
  Subject: Re: pgsql: Add functions gcd() and lcm() for integer and numeric types.
  In-Reply-To: <E1ivM3n-0004P4-LS@gemulon.postgresql.org>
  References: <E1ivM3n-0004P4-LS@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox