Re: equality of t_INTMODs

Karim Belabas <[email protected]>
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <[email protected]>
Hi Max,

* Max Alekseyev [2025-01-24 16:12]:
> In view of a recently discovered issue in Sage (
> https://github.com/sagemath/sage/issues/39372), I'd like to check how the
> following two (in)equalities co-exist in PARI/GP. Do they violate any
> design conventions and/or represent a notable exception to those?
> 
> ? Mod(14,20) == Mod(39,55)
> %1 = 0
> ? Mod(14,20) - Mod(39,55) == 0
> %2 = 1

They do violate the design convention (x == y iff x - y == 0;
use the === operator for proper equality without implicit coercion).

t_POLMOD had the same issue. Both issues are now fixed in 'master'.

Cheers,

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux, Vice-président en charge du Numérique
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.