28 Commits

Author SHA1 Message Date
Sergey B Kirpichev 5d66b10f53 Use Fraction's with the python-gmp 2025-07-03 22:16:18 +03:00
Sergey B Kirpichev 33eb8b787b Add python-gmp as optional backend (gmpy2 alternative)
Closes #895
2025-04-28 20:52:16 +03:00
Sergey B Kirpichev 23b5d390bc Revert "Add python-gmp as optional backend (gmpy2 alternative)" 2025-03-01 05:29:44 +03:00
Sergey B Kirpichev 4d166d8853 Add python-gmp as optional backend (gmpy2 alternative)
Closes #895
2025-02-28 08:48:32 +03:00
Sergey B Kirpichev 4c9a2ef9cd Simplify backend handling in libintmath.py/libmpf.py 2025-02-28 08:47:50 +03:00
Sergey B Kirpichev 5fdae7bc12 Cleanup backend.py 2024-09-09 10:00:58 +03:00
Sergey B Kirpichev 2a52f5a59a Drop libmp.HASH_BITS 2024-04-05 11:50:02 +03:00
Sergey B Kirpichev ab17cd8856 Drop libmp.HASH_MODULUS 2024-04-05 11:50:02 +03:00
Sergey B Kirpichev 25d326c95a Use asserts in normalize(), drop MPMATH_STRICT
For production code this could be removed by -O optimization.
2024-02-24 06:28:44 +03:00
Sergey B Kirpichev 89d106ab23 Remove sage backend
Closes #705
Closes #574
2023-10-19 05:32:39 +03:00
Sergey B Kirpichev 721e2571eb Drop private mpq class, use Rational's provided by backend 2023-05-19 07:03:11 +03:00
Sergey B Kirpichev fb7ff23c52 Drop workaround for old gmpy2<2.1.0a1 (mpz was a factory function) 2023-04-30 08:53:44 +03:00
Sergey B Kirpichev c492e80805 Drop workaround for gmpy 1.x (we require gmpy2>=2.1.0a4 anyway) 2023-04-30 08:53:44 +03:00
Fangchen Li dfc289289d Drop py2 support (#629)
* remove xrange compat shim
* remove str compat shim
* remove exec compat shim
* remove object from class defination
* remove misc workarounds for python versions <3.5
* remove __future__ imports
* update readme
* Update setup.cfg

Closes #594

Co-authored-by: Fredrik Johansson <fredrik.johansson@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Colin B. Macdonald <cbm@m.fsf.org>
2023-03-30 04:50:18 +03:00
Jakub Wilk 5ad1d2f88d Fix sys.version comparisons
"sys.version >= '3.2'" will break in Python 3.10.
2020-10-12 09:32:28 +02:00
Pauli Virtanen 84ca137ff8 Enable sage backend by default only if SAGE_ROOT is set
It's possible to install the Sage system as a normal Python package, as
e.g. in Fedora/Debian. In this case, presence of `sage.all` is not an
indicator whether the user is running Sage, and checking for 'SAGE_ROOT'
is more reliable.
2019-08-04 14:15:43 +03:00
Sergey B Kirpichev 03b7514510 Drop dependency on six and implement exec() function for py2
We use "imports from future" to get print() function.
2019-02-03 15:00:19 +03:00
Sergey B Kirpichev 72ac616822 Unbundle six library 2018-12-23 17:44:34 +03:00
Arne Brys f71108b158 fredrik-johansson/mpmath#344
Rewrite the python major version selection to make it work if something else has redefined xrange.
2017-07-26 21:14:37 +02:00
Fredrik Johansson 63b247c5cf fix a bunch of doctests 2012-12-31 00:41:44 +01:00
Fredrik Johansson fd2e8dcccd include Benjamin Peterson's six.py, and finally fix the annoying exec bug 2012-12-31 00:09:19 +01:00
Case Van Horsen d3ca406a6f Changes to support the new hashing algorithm in Python 3.2 2011-01-16 21:41:24 +00:00
Fredrik Johansson 3bb0f4c5cd some more py3 compatibility fixes 2011-01-08 23:11:04 +00:00
Fredrik Johansson 5c8e4aa5b4 import xrange from libmp.backend to work in python 3 2011-01-08 22:54:03 +00:00
Fredrik Johansson c8270cfcc5 use int when long is not available 2011-01-08 22:22:11 +00:00
Case Van Horsen f06fa901b0 Added compatibility with gmpy2. Only changes are in import logic and scan1() -> bit_scan1(). 2010-08-25 05:10:26 +00:00
Fredrik Johansson c5d1125530 Reorganization to support the improved Cython backend in Sage. A number of internal methods have been renamed in the process. The patch also contains some other optimizations. 2010-02-03 00:56:42 +00:00
Fredrik Johansson 3710518085 some internal renaming 2010-01-12 20:21:08 +00:00