Ask Your Question

Revision history [back]

click to hide/show revision 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.