Home Online Manual
Top
Back: is_zero
Forward: maxcoef
FastBack: inout_lib
FastForward: random_lib
Up: poly_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.6.6 lcm

Procedure from library poly.lib (see poly_lib).

Usage:
lcm(p[,q]); p int/intvec q a list of integers or
p poly/ideal q a list of polynomials

Return:
the least common multiple of p and q:
- of type int if p is an int/intvec
- of type poly if p is a poly/ideal

Example:
 
LIB "poly.lib";
ring  r = 0,(x,y,z),lp;
poly  p = (x+y)*(y+z);
poly  q = (z4+2)*(y+z);
lcm(p,q);
==> xyz4+2xy+xz5+2xz+y2z4+2y2+yz5+2yz
ideal i=p,q,y+z;
lcm(i,p);
==> xyz4+2xy+xz5+2xz+y2z4+2y2+yz5+2yz
lcm(2,3,6);
==> 6
lcm(2..6);
==> 60