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

Marco Bodrato bodrato at mail.dm.unipi.it
Fri May 18 05:35:57 UTC 2018


Ciao,

Il Mer, 14 Marzo 2018 8:10 pm, Niels Möller ha scritto:
> "Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:
>
>> #if defined(USE_FLOAT_H)
>>  #include <float.h>
>> #endif
>
> This won't work well for mini-gmp.

>>> 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 not a assume it for GMP?

Maybe, at the moment, we should always use float.h for mini-gmp, except
when bootstraping GMP?

I mean, something like:

diff -r 41e50c4fdc46 bootstrap.c
--- a/bootstrap.c       Wed May 16 08:36:03 2018 +0200
+++ b/bootstrap.c       Fri May 18 07:24:52 2018 +0200
@@ -29,6 +29,7 @@
 see https://www.gnu.org/licenses/.  */


+#define DONT_USE_FLOAT_H 1
 #include "mini-gmp/mini-gmp.c"

 #define MIN(l,o) ((l) < (o) ? (l) : (o))
diff -r 41e50c4fdc46 mini-gmp/mini-gmp.c
--- a/mini-gmp/mini-gmp.c       Wed May 16 08:36:03 2018 +0200
+++ b/mini-gmp/mini-gmp.c       Fri May 18 07:24:52 2018 +0200
@@ -50,6 +50,9 @@

 #include "mini-gmp.h"

+#if !defined(DONT_USE_FLOAT_H)
+#include <float.h>
+#endif



Ĝis,
m

-- 
http://bodrato.it/



More information about the gmp-devel mailing list