mini-gmp mpz_{get,set}_d not fully compatible with GMP

Marco Bodrato bodrato at mail.dm.unipi.it
Wed Mar 14 06:51:02 UTC 2018


Ciao,

Il Mar, 13 Marzo 2018 5:46 pm, Vincent Lefevre ha scritto:
> On 2018-03-13 17:29:48 +0100, Marc Glisse wrote:
>> just assume that float.h is always available nowadays. Or even assume
>> that all double are 64-bit binary IEEE numbers...

#if defined(USE_FLOAT_H)
 #include <float.h>
#endif

#if defined(DBL_MANT_DIG) && FLT_RADIX == 2
 #define GMP_BITS_PER_DOUBLE DBL_MANT_DIG
#endif

#if !defined(GMP_BITS_PER_DOUBLE)
 #define GMP_BITS_PER_DOUBLE (53)
#endif

> I'd also say that <float.h> can be assumed to be available.

mini-gmp is used to bootstrap GMP... should we assume something for mini-
if we do nota assume it for GMP?

On the other side, while bootstraping, mini-gmp is not used for
conversions to/from double. In my opinion we can live with a mini-gmp that
by dafault is exact only for 64-bit binary IEEE numbers, as Marc suggests,
and can be adapted to other formats with some user intervention.

Ĝis,
m

-- 
http://bodrato.it/papers/



More information about the gmp-devel mailing list