I just noticed in Integer, too, the invert method which gives the
multiplicative inverse mode n of a number:
>>> invert(S(3),5)
2
>>> (3*2)%5 == 1
True
>>> invert(S(4),6)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sympy\polys\polytools.py", line 4249, in invert
return f.invert(g)
File "sympy\core\numbers.py", line 1322, in invert
raise ZeroDivisionError("zero divisor")
ZeroDivisionError: zero divisor
To find an Integer given a description of it's modulus profile perhaps
a method "from_moduli" could be added so Integer.from_moduli((2, 3),
(3, 5)) would give 8. Hector, Mateusz, anyone else: does that look
like a good way to construct it? Is there a better method name?
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.