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

◆ grandom() [2/2]

const mpreal mpfr::grandom ( unsigned int seed = 0)
inline

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}
static gmp_randstate_t state
Definition random.cpp:18