diff options
| author | serpilliere <devnull@localhost> | 2012-06-22 11:16:45 +0200 |
|---|---|---|
| committer | serpilliere <devnull@localhost> | 2012-06-22 11:16:45 +0200 |
| commit | a5f2c46631a3a1bfd142666b24842685d51f8d7e (patch) | |
| tree | cb27b3e201e6837eb8b45a521fa02ed541c0e0d8 | |
| parent | b35f0f2217f4ffe27d46f6618d54689746f50af0 (diff) | |
| download | miasm-a5f2c46631a3a1bfd142666b24842685d51f8d7e.tar.gz miasm-a5f2c46631a3a1bfd142666b24842685d51f8d7e.zip | |
uint: add pow, rpow
| -rw-r--r-- | miasm/tools/modint.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/miasm/tools/modint.py b/miasm/tools/modint.py index 2dee2b38..75664597 100644 --- a/miasm/tools/modint.py +++ b/miasm/tools/modint.py @@ -132,6 +132,10 @@ class moduint(object): return hex(self.arg) def __abs__(self): return abs(self.arg) + def __rpow__(self, v): + return v**self.arg + def __pow__(self, v): + return self.__class__(self.arg**v) class modint(moduint): def __init__(self, arg): |