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

log1p(PythonObject) -- logarithm plus one of a python object

Description

This calls Python's built-in math.log1p function, which computes the logarithm of x plus one. This is more accurate than computing log(x + 1) for small values of x.

i1 : log(1 + toPython 1e-10)

o1 = 1.000000082690371e-10

o1 : PythonObject of class float
i2 : log1p toPython 1e-10

o2 = 9.999999999500001e-11

o2 : PythonObject of class float

See also

Ways to use this method:


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