| 1 | initial version |
Ordering of p-adics is not terribly meaningful of course but it should at least be consistent. So I think this is a bug.
If I understood things correctly, the code that eventually runs is:
mpz_sub(holder.value, a, b)
mpz_mod(holder.value, holder.value, prime_pow.pow_mpz_t_tmp(prec))
return mpz_sgn(holder.value)
The problem here is that mpz_mod is always non-negative so mpz_sgn never returns -1.
I created https://trac.sagemath.org/ticket/28704#ticket to track this issue.
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.