Karim Belabas on Thu, 22 Feb 2018 16:19:37 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: sets of t_POLMOD |
* Max Alekseyev [2018-02-22 16:12]: > Hello! > > I observe the following behavior in Version 2.10.0 (development 21603-bef585b) > > ? S = Set( [Mod(0,x^2+1)] ) > %1 = [Mod(0, x^2 + 1)] > ? S*x > %2 = [Mod(0, x^2 + 1)] > ? setintersect(S,Set(S*x)) > %3 = [] > > Isn't this a bug? Not really: S and S*x *are* different [ inspect with dbg_x() or \x ]. They are printed the same way and will test equal (==, mathematical equality allowing coercion), but not identical (===, typed equality) : (16:16) gp > S = Set( [Mod(0,x^2+1)] ) %1 = [Mod(0, x^2 + 1)] (16:16) gp > S==S*x %2 = 1 (16:16) gp > S===S*x \\ the reason is that lift S*x is Pol(0), not 0 %3 = 0 (16:16) gp > setintersect(S, simplify(S*x)) %4 = [Mod(0, x^2 + 1)] Cheers, K.B. -- Karim Belabas, IMB (UMR 5251) Tel: (+33) (0)5 40 00 26 17 Universite de Bordeaux Fax: (+33) (0)5 40 00 21 23 351, cours de la Liberation http://www.math.u-bordeaux.fr/~kbelabas/ F-33405 Talence (France) http://pari.math.u-bordeaux.fr/ [PARI/GP] `