random.c
来自「蚂蚁聚类算法源代码(ant based clustering algorithm」· C语言 代码 · 共 17 行
C
17 行
#include "random.h"
/* Copyright Numerical Recipes in C */
double ran0(long *idum)
{
long k;
double ans;
*idum ^= MASK;
k=(*idum)/IQ;
*idum=IA*(*idum-k*IQ)-IR*k;
if (*idum < 0) *idum += IM;
ans=AM*(*idum);
*idum ^= MASK;
return ans;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?