> If one wants to have the same answer as Python does (always nonnegative), > then function math.fmod can be used. For example, > sage: from math import fmod > sage: fmod(6e-6,10e-6) > 6.0000000000000002e-06
first Python does not always give a nonnegative result: >>> (6e-6) % (-10e-6) -4.0000000000000007e-06 secondly this does not match the math.fmod function either: sage: from math import fmod sage: fmod(6e-6,-10e-6) 6.0000000000000002e-06 I would recommend that Sage "%" follows one of the C99 standard functions, fmod or remainder. Maybe fmod would be better, and remainder could be provided as a different method. Paul Zimmermann -- 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 To unsubscribe, reply using "remove me" as the subject.