mpf_urandomb and precision

Marc Glisse marc.glisse at
Sun May 1 11:46:50 CEST 2011


when I read the documentation of mpf_urandomb:

"Generate a uniformly distributed random float in rop, such that 0 <= rop 
< 1, with nbits significant bits in the mantissa."

I expected that if nbits was large, the function would increase the 
precision of rop so the nbits would fit. Instead, the code reduces nbits 
so that it fits prec. Should I append "or less if the precision of rop is 
smaller" to the documentation?

Marc Glisse

More information about the gmp-discuss mailing list