changeset 634:9d4a0ade3918

Add floor division (//) overloading to field elements.
author Martin Geisler <mg@daimi.au.dk>
date Fri, 04 Apr 2008 11:03:26 +0200
parents 6581d7c7bc99
children a7f03661f81d
files viff/field.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/viff/field.py	Fri Apr 04 10:37:46 2008 +0200
+++ b/viff/field.py	Fri Apr 04 11:03:26 2008 +0200
@@ -217,6 +217,7 @@
         return self * ~other
 
     __truediv__ = __div__
+    __floordiv__ = __div__
 
     def __rdiv__(self, other):
         """Division (reflected argument version).
@@ -227,6 +228,7 @@
         return GF256(other) / self
 
     __rtruediv__ = __rdiv__
+    __rfloordiv__ = __rdiv__
 
     def __neg__(self):
         """Negation."""
@@ -418,12 +420,14 @@
                 return self * ~GFElement(other)
 
         __truediv__ = __div__
+        __floordiv__ = __div__
 
         def __rdiv__(self, other):
             """Division (reflected argument version)."""
             return GFElement(other) / self
 
         __rtruediv__ = __rdiv__
+        __rfloordiv__ = __rdiv__
 
         def sqrt(self):
             """Square root.