初学,这段c语言什么意思?
/*shifts:67108864=0x4000000,9007199254740992=0x20000000000000*/longa=rk_random(state)...
/* shifts : 67108864 = 0x4000000, 9007199254740992 = 0x20000000000000 */
long a = rk_random(state) >> 5, b = rk_random(state) >> 6;
return (a * 67108864.0 + b) / 9007199254740992.0;
}
// Initialise the random generator with the specified seed
void rseed(unsigned long seed) {
rk_seed(seed,&localState);
//srand(seed);
}
unsigned long rndl() {
return rk_random(&localState);
}
// Returns a uniform distributed double value in the interval ]0,1[
double rnd() {
return rk_double(&localState); 展开
long a = rk_random(state) >> 5, b = rk_random(state) >> 6;
return (a * 67108864.0 + b) / 9007199254740992.0;
}
// Initialise the random generator with the specified seed
void rseed(unsigned long seed) {
rk_seed(seed,&localState);
//srand(seed);
}
unsigned long rndl() {
return rk_random(&localState);
}
// Returns a uniform distributed double value in the interval ]0,1[
double rnd() {
return rk_double(&localState); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询