Mod(B*x, M) doesn't return an integer but an element of Integers(M) = the ring of integers modulo M. So the differences you see are because B is a normal integer so the subtractions involving B and M are just integer subtractions, but the substractions involing x and M are substractions in Integers(M)
-- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org