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

Vincent Lefevre vincent at vinc17.net
Mon Mar 12 19:06:10 UTC 2018


On 2018-03-12 18:53:37 +0100, Marco Bodrato wrote:
> double
> mpz_get_d (const mpz_t u)
> {
>   static int c = 0;
>   static int __initialized = 0;
> 
>   if (__initialized != 1) {
>     c = gmp_tests_dbl_mant_bits ();
>     *((volatile int *) &__initialized) = 1;
>   }

FYI, this is not thread-safe.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-devel mailing list