Macaulay2 » Documentation
Packages » Python » PythonObject » lcm(PythonObject,PythonObject)
next | previous | forward | backward | up | index | toc

lcm(PythonObject,PythonObject) -- least common multiple of Python objects

Description

This computes the least common multiple of two Python objects.

i1 : lcm(toPython 12, toPython 15)

o1 = 60

o1 : PythonObject of class int

If one of the arguments is a Macaulay2 object, then it is first converted to a Python object.

i2 : lcm(toPython 12, 15)

o2 = 60

o2 : PythonObject of class int
i3 : lcm(12, toPython 15)

o3 = 60

o3 : PythonObject of class int

Since lcm is a binary method, it will accept any number of arguments.

i4 : lcm toPython 5

o4 = 5

o4 : PythonObject of class int
i5 : lcm (toPython 7, toPython 14, 28)

o5 = 28

o5 : PythonObject of class int

See also

Ways to use this method:


The source of this document is in Python/doc/number-theory.m2:124:0.