lcm()

A system function for obtaining the least common multiple

lcm() is a system function for obtaining the least common multiple

lcm() was added in PostgreSQL 13 (commit 13661ddd).

Change history

Examples

postgres=# SELECT lcm(8,2);
 lcm 
-----
   8
(1 row)

postgres=# SELECT lcm(8,3);
 lcm 
-----
  24
(1 row)

postgres=# SELECT lcm(8,4);
 lcm 
-----
   8
(1 row)
  • PostgreSQL documentation: lcm()

Categories

System function

See also

gcd()