Hi sage-devel, I think 1) should be the default but I find myself needing 2) quite a bit these days (also for integers)
Cheers, Martin Vincent Delecroix writes: > Hello, > > While responding to this ask question > > http://ask.sagemath.org/question/31740/why-112321-and-111320 > > I discovered some inconsistencies with the modulo operators in Sage. We > indeed have three coexisting definitions for x % y > > 1) the unique x' between [0,y) of the form x + ny (used when both x > and y are integers) > > 2) the unique x' between (-y/2, y/2] of the form x+ny (used when x is > a float) > > 3) the result of an operation in Zmod(y) and a lift to {0, ..., y-1} > (used when x is a rational and y a float) > > I would suggest to always use 1) but I am not sure if my opinion is > shared by many mathematicians and Sage programmers... > > Best, > Vincent -- _pgp: https://keybase.io/martinralbrecht _www: https://martinralbrecht.wordpress.com _jab: martinralbre...@jabber.ccc.de _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: PGP signature