about summary refs log tree commit diff stats
path: root/miasm2/expression/modint.py
diff options
context:
space:
mode:
authorAjax <commial@gmail.com>2015-11-13 17:43:36 +0100
committerAjax <commial@gmail.com>2015-11-16 09:22:29 +0100
commit84dd8d451611937b004fd9f8c992e0688ba0828b (patch)
treecd2f86464dc23317b58b8aedd56452c533f88f07 /miasm2/expression/modint.py
parentc488c7780ada00daa5b1ca8a27a585abfacd2905 (diff)
downloadmiasm-84dd8d451611937b004fd9f8c992e0688ba0828b.tar.gz
miasm-84dd8d451611937b004fd9f8c992e0688ba0828b.zip
ModInt: mimic C division instead of Python rounded one
Diffstat (limited to 'miasm2/expression/modint.py')
-rw-r--r--miasm2/expression/modint.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/miasm2/expression/modint.py b/miasm2/expression/modint.py
index 8bad5ccb..72757e75 100644
--- a/miasm2/expression/modint.py
+++ b/miasm2/expression/modint.py
@@ -44,9 +44,9 @@ class moduint(object):
     def __div__(self, y):
         if isinstance(y, moduint):
             cls = self.maxcast(y)
-            return cls(self.arg / y.arg)
+            return cls(int(float(self.arg) / y.arg))
         else:
-            return self.__class__(self.arg / y)
+            return self.__class__(int(float(self.arg) / y))
 
     def __int__(self):
         return int(self.arg)