Re: [sage-support] Equal lists may not be equal

2012-04-09 Thread Alastair Irving
On 09/04/2012 21:02, Kent Morrison wrote: In this snippet of Sage code I believe that pos is [1,2,3]. But mod(1,p) in pos evaluates to False, while mod(1,p) in [1,2,3] evaluates to True. However 1%p in pos and 1%p in [1,2,3] both evaluate to True. This behaviour can be understood by using the ty

Re: [sage-support] Equal lists may not be equal

2012-04-09 Thread Starx
Note: sage: type(mod(1,p)) sage: type(1%p)   sage: type(pos[0]) There is no coercion between rationals and integers modulo a number. There is on the other hand a coercion from integers to integers modulo a number. In all the comparisons that returned true Sage knows how to coerce both sides in

[sage-support] Equal lists may not be equal

2012-04-09 Thread Kent Morrison
In this snippet of Sage code I believe that pos is [1,2,3]. But mod(1,p) in pos evaluates to False, while mod(1,p) in [1,2,3] evaluates to True. However 1%p in pos and 1%p in [1,2,3] both evaluate to True. p=7 pos=[1..(p-1)/2] pos==[1,2,3], mod(1,p) in pos, mod(1,p) in [1..3], 1%p