summaryrefslogtreecommitdiffstats
path: root/src/sage/rings/padics/padic_printing.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'src/sage/rings/padics/padic_printing.pyx')
-rw-r--r--src/sage/rings/padics/padic_printing.pyx7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/sage/rings/padics/padic_printing.pyx b/src/sage/rings/padics/padic_printing.pyx
index 7e38ea7..178ffe1 100644
--- a/src/sage/rings/padics/padic_printing.pyx
+++ b/src/sage/rings/padics/padic_printing.pyx
@@ -1005,13 +1005,12 @@ cdef class pAdicPrinter_class(SageObject):
v = elt.valuation()
if v >= 0:
lift_z = <Integer> elt.lift()
+ pprec = self.prime_pow.pow_Integer(mpz_get_ui((<Integer>elt.precision_absolute()).value))
else:
lift_z = <Integer> elt.unit_part().lift()
+ pprec = self.prime_pow.pow_Integer(mpz_get_ui((<Integer>elt.precision_relative()).value))
+ mpz_mod(lift_z.value, lift_z.value, pprec.value)
if not pos:
- if v >= 0:
- pprec = self.prime_pow.pow_Integer(mpz_get_ui((<Integer>elt.precision_absolute()).value))
- else:
- pprec = self.prime_pow.pow_Integer(mpz_get_ui((<Integer>elt.precision_relative()).value))
if lift_z > pprec / 2:
mpz_sub(lift_z.value, lift_z.value, pprec.value)
else: