~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ec.c: Fix reported function name in `ec2osp'.
[catacomb-python]
/
catacomb
/
__init__.py
diff --git
a/catacomb/__init__.py
b/catacomb/__init__.py
index
5399182
..
5e7aa89
100644
(file)
--- a/
catacomb/__init__.py
+++ b/
catacomb/__init__.py
@@
-312,15
+312,18
@@
class BaseRat (object):
def __mul__(me, you):
n, d = _split_rat(you)
return type(me)(me._n*n, me._d*d)
def __mul__(me, you):
n, d = _split_rat(you)
return type(me)(me._n*n, me._d*d)
- def __div__(me, you):
+ __rmul__ = __mul__
+ def __truediv__(me, you):
n, d = _split_rat(you)
return type(me)(me._n*d, me._d*n)
n, d = _split_rat(you)
return type(me)(me._n*d, me._d*n)
- def __rdiv__(me, you):
+ def __r
true
div__(me, you):
n, d = _split_rat(you)
return type(me)(me._d*n, me._n*d)
n, d = _split_rat(you)
return type(me)(me._d*n, me._n*d)
+ __div__ = __truediv__
+ __rdiv__ = __rtruediv__
def __cmp__(me, you):
n, d = _split_rat(you)
def __cmp__(me, you):
n, d = _split_rat(you)
- return
type(me)
(me._n*d, n*me._d)
+ return
cmp
(me._n*d, n*me._d)
def __rcmp__(me, you):
n, d = _split_rat(you)
return cmp(n*me._d, me._n*d)
def __rcmp__(me, you):
n, d = _split_rat(you)
return cmp(n*me._d, me._n*d)
@@
-340,8
+343,10
@@
class _tmp:
def mont(x): return MPMont(x)
def barrett(x): return MPBarrett(x)
def reduce(x): return MPReduce(x)
def mont(x): return MPMont(x)
def barrett(x): return MPBarrett(x)
def reduce(x): return MPReduce(x)
- def __div__(me, you): return IntRat(me, you)
- def __rdiv__(me, you): return IntRat(you, me)
+ def __truediv__(me, you): return IntRat(me, you)
+ def __rtruediv__(me, you): return IntRat(you, me)
+ __div__ = __truediv__
+ __rdiv__ = __rtruediv__
_repr_pretty_ = _pp_str
_augment(MP, _tmp)
_repr_pretty_ = _pp_str
_augment(MP, _tmp)
@@
-352,8
+357,10
@@
class _tmp:
def halftrace(x, y): return x.reduce().halftrace(y)
def modsqrt(x, y): return x.reduce().sqrt(y)
def quadsolve(x, y): return x.reduce().quadsolve(y)
def halftrace(x, y): return x.reduce().halftrace(y)
def modsqrt(x, y): return x.reduce().sqrt(y)
def quadsolve(x, y): return x.reduce().quadsolve(y)
- def __div__(me, you): return GFRat(me, you)
- def __rdiv__(me, you): return GFRat(you, me)
+ def __truediv__(me, you): return GFRat(me, you)
+ def __rtruediv__(me, you): return GFRat(you, me)
+ __div__ = __truediv__
+ __rdiv__ = __rtruediv__
_repr_pretty_ = _pp_str
_augment(GF, _tmp)
_repr_pretty_ = _pp_str
_augment(GF, _tmp)