Re: Bitfield subtlety

2018-03-27 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes: > In C++, a bit field whose base type is not explicitly signed or unsigned > gets undefined signedness. It would be desirable to use stdint.h's > int64_t, but while that is signed, it is not guaranteed to be explicitly > so. Ouch, it's pretty subtle

Re: Bitfield subtlety

2018-03-27 Thread Marc Glisse
On Wed, 28 Mar 2018, Torbjörn Granlund wrote: I am playing with a GMP version which allows greater mpz numbers than what is currently handled. The idea is to combine the _mp_size and _mp_alloc fields such that _mp_size becomes 40 bits while _mp_alloc becomes a custom float. I ran into some

Bitfield subtlety

2018-03-27 Thread Torbjörn Granlund
I am playing with a GMP version which allows greater mpz numbers than what is currently handled. The idea is to combine the _mp_size and _mp_alloc fields such that _mp_size becomes 40 bits while _mp_alloc becomes a custom float. I ran into some problems with C and C++ when it comes to bit

Re: Faster table compute in mpn_sec_powm

2018-03-27 Thread Torbjörn Granlund
"Marco Bodrato" writes: I unified definitions... Correctly, I hope! LGTM, thanks! -- Torbjörn Please encrypt, key id 0xC8601622 ___ gmp-devel mailing list gmp-devel@gmplib.org https://gmplib.org/mailman/listinfo/gmp-devel

Re: Miller-Rabin

2018-03-27 Thread paul zimmermann
Niels, > int > mpz_miller_rabin_uis (mpz_srcptr n, size_t count, unsigned long *bases); this interface would be nice for me. I don't think a bignum base is necessary, unless you use REDC in powm, in which case (for n having at least 2 limbs) it might be faster to use a base b such