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

truncate(PythonObject) -- truncate a python object

Description

This calls Python's built-in math.trunc function, which rounds toward zero.

i1 : truncate toPython 5.8

o1 = 5

o1 : PythonObject of class int
i2 : truncate toPython(-5.8)

o2 = -5

o2 : PythonObject of class int

See also

Ways to use this method:


The source of this document is in Python/doc/floating-point.m2:137:0.