I'm pleased to announce a new alpha release of GMPY2.
GMPY2 is a wrapper for GMP and MPFR multiple-precision
arithmetic libraries.

GMPY2 alpha2 introduces context manager support for
MPFR arithmetic. It's now possible to trigger an exception
when comparing against "nan" (and other for other
events that normally generate "nan" or "inf").
import gmpy2
gmpy2.mpfr("nan") == gmpy2.mpfr("nan")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
gmpy2.RangeError: comparison with NaN

If you have an interest in multiple-precision arithmetic
or want more control over the handling of exceptional
events in floating point arithmetic, please check out

GMPY2 is available for download from:


Experimental release

To simplify the codebase, allow for changes in the API,
and support simultaneous installation, the development
version has been renamed to GMPY2. The following is list
of changes in GMPY2:

In 2.0.0a0

* support for a mutable integer type "xmpz"
* removal of random number functions
* "xmpz" supports slices for setting/clearing bits
* some methods have been renamed (scan1 -> bit_scan1)
* support for Python prior to 2.6 has been removed
* support for all division modes has been added
* ceiling - round to +Infinity
* floor - round to -Infinity
* truncate - round to zero
* 2exp - division by a power of 2
* support is_even() and is_odd()

In 2.0.0a1

* support for the MPFR floating point library

In 2.0.0a2
* context manager support from controlling MPFR
* can raise Python exceptions when exceptional events
occur with MPFR arithmetic; for example, comparing
against "nan" can trigger an exception
* more complete coverage for MPFR
* many function names were changed to be more consistent

Please report any issues!


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
postedJun 9, '11 at 6:51a
activeJun 9, '11 at 6:51a

1 user in discussion

Casevh: 1 post



site design / logo © 2022 Grokbase