Inconsistent cmp for padics
Reported by: 
saraedum 
Owned by: 

Priority:

minor

Milestone:


Component:

padics

Keywords:

cmp

Cc:

roed, slelievre, caruso

Merged in:


Authors:


Reviewers:


Report Upstream:

N/A

Work issues:


Branch:


Commit:


Dependencies:


Stopgaps:


As reported in https://ask.sagemath.org/question/48658/possiblebugin_cmp_function/ cmp
is inconsistent for padics, i.e., a<b
does not imply b>a
. While ordering padics has no deep meaning, it should at least be consistent.
The problem seems to be in ccmp
doing the following
mpz_sub(holder.value, a, b)
mpz_mod(holder.value, holder.value, prime_pow.pow_mpz_t_tmp(prec))
return mpz_sgn(holder.value)
But mpz_mod is always nonnegative.
Change History (10)
Milestone: 
sage9.0 →
sage9.1

Milestone: 
sage9.1 →
sage9.2

Milestone: 
sage9.2 →
sage9.3

Milestone: 
sage9.3 →
sage9.4

Milestone: 
sage9.4 →
sage9.5

Milestone: 
sage9.5 →
sage9.6

Milestone: 
sage9.6 →
sage9.7

Milestone: 
sage9.7 →
sage9.8

Cc: 
caruso added; xcaruso removed

Ticket retargeted after milestone closed