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

log(PythonObject,PythonObject) -- logarithm of a python object

Description

This calls Python's built-in math.log function, which computes the logarithm of x to the given base. If no base is given, then the natural logarithm is computed.

i1 : log toPython exp 1

o1 = 1.0

o1 : PythonObject of class float
i2 : log_(toPython 2) toPython 8

o2 = 3.0

o2 : PythonObject of class float

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

i3 : log_10 toPython 100

o3 = 2.0

o3 : PythonObject of class float
i4 : log_(toPython 3) 27

o4 = 3.0

o4 : PythonObject of class float

See also

Ways to use this method:


The source of this document is in Python/doc/exp-log.m2:85:0.