Re: equality of t_INTMODs

Max Alekseyev <[email protected]>
Newsgroups gmane.comp.mathematics.pari.user
Message-ID <CAJkPp5N88OLMYGF-qcpj4fpmyu+MzR_uUPui4OkVKdhVM_MkBw@mail.gmail.com>
Hi Karim,

After the fix we have

? Mod(14,20) == Mod(39,55)
%1 = 1

I understand why, but nevertheless it looks very confusing.

Regards,
Max


On Fri, Jan 24, 2025 at 10:58 AM Karim Belabas <
[email protected]> wrote:

> 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.