diff options
| author | Ajax <commial@gmail.com> | 2015-11-13 17:43:36 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-11-16 09:22:29 +0100 |
| commit | 84dd8d451611937b004fd9f8c992e0688ba0828b (patch) | |
| tree | cd2f86464dc23317b58b8aedd56452c533f88f07 /miasm2/expression/modint.py | |
| parent | c488c7780ada00daa5b1ca8a27a585abfacd2905 (diff) | |
| download | miasm-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.py | 4 |
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) |