Macaulay2 Engine
Loading...
Searching...
No Matches

◆ grandom [2/2]

const mpreal grandom ( unsigned int seed = 0)
friend

Definition at line 2892 of file mpreal.h.

2893{
2894 static gmp_randstate_t state;
2895 static bool initialize = true;
2896
2897 if(initialize)
2898 {
2899 gmp_randinit_default(state);
2900 gmp_randseed_ui(state,0);
2901 initialize = false;
2902 }
2903
2904 if(seed != 0) gmp_randseed_ui(state,seed);
2905
2906 return mpfr::grandom(state);
2907}
const mpreal grandom(gmp_randstate_t &state, mp_rnd_t rnd_mode=mpreal::get_default_rnd())
Definition mpreal.h:2881
static gmp_randstate_t state
Definition random.cpp:18

References mpfr::grandom(), grandom, mpreal(), and state.