GMP 6.1.0 release candidate available

paul zimmermann Paul.Zimmermann at inria.fr
Fri Oct 30 09:49:57 UTC 2015


> Date: Fri, 30 Oct 2015 07:35:15 +0100
> From: "Marco Bodrato" <bodrato at mail.dm.unipi.it>
> 
> Ciao,
> 
> Il Ven, 30 Ottobre 2015 5:26 am, Niels Möller ha scritto:
> > "Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:
> 
> >> No *rand* supported by mini-gmp,
> >
> > And I don't think it should. Do you have any use case where you need
> > sophisticated (but non-cryptographic) random numbers *and* it makes
> > sense to use mini-gmp?
> 
> Probably not, but having non-sophisticated-simply-working _rand functions
> would be handy to run with mini-gmp a test-suite you wrote for a piece of
> code using GMP :-)
> 
> -- 
> http://bodrato.it/

agreed. I wrote a very simple interface using lrand48() for MPFR
(file src/mpfr-mini-gmp.c) which is based on the following:

static mp_limb_t
random_limb (void)
{
  /* lrand48() only gives 31 bits */
#if GMP_NUMB_BITS == 32
  return lrand48 () + (lrand48 () << 31);
#else /* assume GMP_NUMB_BITS = 64 */
  return lrand48 () + (((mp_limb_t) lrand48 ()) << 31)
    + (((mp_limb_t) lrand48 ()) << 62);
#endif
}

Paul


More information about the gmp-bugs mailing list