gmp_libmpf_urandomb Method |
Generate a uniformly distributed random float in rop, such that 0 ≤ rop < 1, with nbits significant bits in the mantissa or less if the precision of rop is smaller.
Namespace:
Math.Gmp.Native
Assembly:
Math.Gmp.Native (in Math.Gmp.Native.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static void mpf_urandomb(
mpf_t rop,
gmp_randstate_t state,
mp_bitcnt_t nbits
)
Public Shared Sub mpf_urandomb (
rop As mpf_t,
state As gmp_randstate_t,
nbits As mp_bitcnt_t
)
public:
static void mpf_urandomb(
mpf_t^ rop,
gmp_randstate_t^ state,
mp_bitcnt_t nbits
)
static member mpf_urandomb :
rop : mpf_t *
state : gmp_randstate_t *
nbits : mp_bitcnt_t -> unit
Parameters
- rop
- Type: Math.Gmp.Nativempf_t
The result float. - state
- Type: Math.Gmp.Nativegmp_randstate_t
The random number generator state. - nbits
- Type: Math.Gmp.Nativemp_bitcnt_t
Number of significant bits.
Remarks Examples
gmp_randstate_t state = new gmp_randstate_t();
gmp_lib.gmp_randinit_mt(state);
gmp_lib.gmp_randseed_ui(state, 100000U);
mpf_t rop = new mpf_t();
gmp_lib.mpf_init(rop);
gmp_lib.mpf_urandomb(rop, state, 50);
gmp_lib.gmp_randclear(state);
gmp_lib.mpf_clear(rop);
Dim state As New gmp_randstate_t()
gmp_lib.gmp_randinit_mt(state)
gmp_lib.gmp_randseed_ui(state, 100000UI)
Dim rop As New mpf_t()
gmp_lib.mpf_init(rop)
gmp_lib.mpf_urandomb(rop, state, 50)
gmp_lib.gmp_randclear(state)
gmp_lib.mpf_clear(rop)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
See Also