m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
548 B

6 months ago
  1. """
  2. Rational number type based on Python integers.
  3. The PythonRational class from here has been moved to
  4. sympy.external.pythonmpq
  5. This module is just left here for backwards compatibility.
  6. """
  7. from sympy.core.numbers import Rational
  8. from sympy.core.sympify import _sympy_converter
  9. from sympy.utilities import public
  10. from sympy.external.pythonmpq import PythonMPQ
  11. PythonRational = public(PythonMPQ)
  12. def sympify_pythonrational(arg):
  13. return Rational(arg.numerator, arg.denominator)
  14. _sympy_converter[PythonRational] = sympify_pythonrational