diff options
| author | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-16 10:42:40 +0100 |
|---|---|---|
| committer | serpilliere <serpilliere@users.noreply.github.com> | 2015-11-16 10:42:40 +0100 |
| commit | 1f892fabed6300aeb592121af5b2137ac35c07f6 (patch) | |
| tree | 1ff49eb5b7fd59fcdbcd6602ba72764566113884 /miasm2/expression/modint.py | |
| parent | 3eed941e88361f811496311014079c172e058a68 (diff) | |
| parent | 55a81cc899599ae24a4c5322a6d812a24e28a292 (diff) | |
| download | miasm-1f892fabed6300aeb592121af5b2137ac35c07f6.tar.gz miasm-1f892fabed6300aeb592121af5b2137ac35c07f6.zip | |
Merge pull request #273 from commial/fix-python-emul
Fix python emul
Diffstat (limited to 'miasm2/expression/modint.py')
| -rw-r--r-- | miasm2/expression/modint.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/miasm2/expression/modint.py b/miasm2/expression/modint.py index 8bad5ccb..76896eb9 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) @@ -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): |