On 23 October 2016 at 18:06, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > PARI/GP is using Mod the way we want it > > ? Mod(2/3,5) > %1 = Mod(4, 5) > ? Mod(2/3,6) > *** Mod: impossible inverse in Fl_inv: Mod(3, 6). > > And Maple as well > >> 2/3 mod 5; > 4 >> 2/3 mod 6; > Error, the modular inverse does not exist > > This is a good reason to change the behavior of mod in Sage...
and we have mod_ui in Sage sage: (2/3).mod_ui(5) 4 sage: (2/3).mod_ui(6) Traceback (most recent call last): ... ArithmeticError: The inverse of 3 modulo 6 is not defined. (that of course overflow when its argument is too large) I opened #21748 for doing that. -- 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.