Skip to content
Merged
12 changes: 6 additions & 6 deletions src/sage/arith/functions.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,25 @@ def lcm(a, b=None):

Make sure we try `\QQ` and not merely `\ZZ` (:trac:`13014`)::

sage: bool(lcm(2/5, 3/7) == lcm(SR(2/5), SR(3/7))) # optional - sage.symbolic
sage: bool(lcm(2/5, 3/7) == lcm(SR(2/5), SR(3/7))) # needs sage.symbolic
True

Make sure that the lcm of Expressions stays symbolic::

sage: parent(lcm(2, 4))
Integer Ring
sage: parent(lcm(SR(2), 4)) # optional - sage.symbolic
sage: parent(lcm(SR(2), 4)) # needs sage.symbolic
Symbolic Ring
sage: parent(lcm(2, SR(4))) # optional - sage.symbolic
sage: parent(lcm(2, SR(4))) # needs sage.symbolic
Symbolic Ring
sage: parent(lcm(SR(2), SR(4))) # optional - sage.symbolic
sage: parent(lcm(SR(2), SR(4))) # needs sage.symbolic
Symbolic Ring

Verify that objects without lcm methods but which can't be
coerced to `\ZZ` or `\QQ` raise an error::

sage: F.<x,y> = FreeMonoid(2) # optional - sage.groups
sage: lcm(x,y) # optional - sage.groups
sage: F.<x,y> = FreeMonoid(2) # needs sage.groups
sage: lcm(x,y) # needs sage.groups
Traceback (most recent call last):
...
TypeError: unable to find lcm of x and y
Expand Down
2 changes: 1 addition & 1 deletion src/sage/arith/long.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sage.doctest: optional - sage.misc.cython
# sage.doctest: needs sage.misc.cython
r"""
Fast conversion of Python objects to C long
"""
Expand Down
Loading