-
-
Notifications
You must be signed in to change notification settings - Fork 655
Open
Description
https://docs.python.org/3/reference/datamodel.html?highlight=__round__#object.__round__
We should define these special methods so that the built-in round
and math.trunc
, math.floor
, math.ceil
can operate on Sage numbers.
This can help to eliminate imports of floor
and ceil
from sage.functions
throughout the Sage library, which pulls in all of sage.symbolic
.
Related: In the global namespace, we have:
round
=sage.misc.functional.round
,floor
=sage.functions.other.floor
,ceil
=sage.functions.other.ceil
,trunc
- undefined
Component: python3
Author: Frédéric Chapoton
Branch/Commit: public/ticket/25827 @ 53280c5
Issue created by migration from https://trac.sagemath.org/ticket/25827