Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

So that this code works

sage: a = 181.0
sage: b = 360
sage: n = (a / b).round()
sage: b * n + (a % b) == a
True

From the sage docstring (which you can read by typing a.__mod__?)

Return the value of "left - n*right", rounded according to the rounding mode of the parent, where "n" is the integer quotient of "x" divided by "y". The integer "n" is rounded toward the nearest integer (ties rounded to even).