Max Alekseyev on Fri, 24 Jan 2025 17:11:10 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: equality of t_INTMODs |
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/