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

truncate(PythonObject) -- truncate a python object

Synopsis

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

Ways to use this method: