gmpy icon indicating copy to clipboard operation
gmpy copied to clipboard

General Multi-Precision arithmetic for Python 2.6+/3+ (GMP, MPIR, MPFR, MPC)

Results 78 gmpy issues
Sort by recently updated
recently updated
newest added

Hello everyone! I am working on implementing a tool to assess the complexity of CPU architecture porting. It primarily focuses on RISC-V architecture porting. As part of my dataset, I...

An example (~4-5x difference): ``` $ python -m timeit -r10 -s 'from math import factorial as f;from pickle import dumps as d' \ -s 'a=f(1000)' 'd(a)' 50000 loops, best of...

The experimental `powmod_exp_list` function that was added recently [appears to loop over the exponent argument and call `mpz_powm` internally](https://github.com/aleaxit/gmpy/blob/ca7a8f2bd4298dec6cbe10aea08ed28992b2b838/src/gmpy2_pow.c#L364). The similar `powmod_base_list` makes sense to be implemented like this and...

Hi, I encountered a situation that I think is probably a bug. Accessing the sign bits of negative `mpz` and `xmpz` numbers gives different results when the access is done...

Setting the value of an unbounded slice of bits on an xmpz object does not seem to have any effect: ```Python console In [10]: a = xmpz(0) In [11]: a[1:]...

## My requirements I have a really large Python list with a size of 10 to 100 million, and I need to sign each item with the RSA private key,...

```python from gmpy2 import mpz, next_prime, f_mod def squarefreenums(n, Nmax=None): """Returns the first square-free integers. A square-free integer is an integer which is divisible by no other perfect square than...

Hello, I 've done that, if you're interested in including it in the package: ```python from gmpy2 import mpz, mpq from math import floor def contfrac(x, n=10): """ Continued fraction...

Is there any specific reason why `__new__` is not defined for the `gmpy2` types? You already have the `Pympz_new` function, which essentially implements `tp_new`. ``` In [1]: from gmpy2 import...

Isn't it safe to allow threads during long-running mpz operations? For instance ```c diff --git a/src/gmpy2_mul.c b/src/gmpy2_mul.c index e312769..e147508 100644 --- a/src/gmpy2_mul.c +++ b/src/gmpy2_mul.c @@ -45,7 +45,9 @@ GMPy_Integer_MulWithType(PyObject *x,...