On Mon, 15 Jan 2007 04:35:33 -0800, David Joyner <[EMAIL PROTECTED]> wrote:
On 1/15/07, David Kohel <[EMAIL PROTECTED]> wrote:
For x, m != 0 in a Euclidean domain, one should have:
x == m*(x.div(m)) + x.mod(m)
Although one can get the result of x.div(m) as x.quo_rem(m)[0],
but I would suggest having this as a separate function.
Seconded.
It is a separate function, but it's not called "div".
sage: n = 17; m = 5
sage: n//m
3
sage: n % m
2
sage: n.__floordiv__(m)
3
sage: n.__mod__(m)
2
I'm worried that adding div and mod methods too is just going to add
clutter. What about adding functions div and mod to misc/functional.py,
so that one could write
div(n,m)
and
mod(n,m)
Actually, mod is already there, but it returns an elements of Z/mZ.
Thoughts?
William
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---