| 1 | initial version |
Nowadays, the IntegerMod_abstract class has a .lift_centered() method to compute the "symmetric" or "centered" representative for a given residue class:
sage: [x.lift_centered() for x in Zmod(10)]
[0, 1, 2, 3, 4, 5, -4, -3, -2, -1]
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.