diff options
| author | Ajax <commial@gmail.com> | 2015-11-13 17:44:17 +0100 |
|---|---|---|
| committer | Ajax <commial@gmail.com> | 2015-11-16 10:00:03 +0100 |
| commit | 55a81cc899599ae24a4c5322a6d812a24e28a292 (patch) | |
| tree | 1ff49eb5b7fd59fcdbcd6602ba72764566113884 /miasm2/expression/modint.py | |
| parent | 84dd8d451611937b004fd9f8c992e0688ba0828b (diff) | |
| download | miasm-55a81cc899599ae24a4c5322a6d812a24e28a292.tar.gz miasm-55a81cc899599ae24a4c5322a6d812a24e28a292.zip | |
ModInt: mimic C modulo 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 72757e75..76896eb9 100644 --- a/miasm2/expression/modint.py +++ b/miasm2/expression/modint.py @@ -67,9 +67,9 @@ class moduint(object): def __mod__(self, y): if isinstance(y, moduint): cls = self.maxcast(y) - return cls(self.arg % y.arg) + return cls(self.arg - (y.arg * int(float(self.arg)/y.arg))) else: - return self.__class__(self.arg % y) + return self.__class__(self.arg - (y * int(float(self.arg)/y))) def __mul__(self, y): if isinstance(y, moduint): |