📄 stdafx.cpp
字号:
// stdafx.cpp : source file that includes just the standard includes
// probp.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
float bedlam(long idum)
{
int xj;
long xk;
static long iy=0;
static long iv[NTAB];
float temp;
if(idum <= 0 || !iy)
{
if(-(idum) < 1)
{
idum = 1 + idum;
}
else
{
idum = -(idum);
}
for(xj = NTAB+7; xj >= 0; xj--)
{
xk = (idum) / IQ;
idum = IA * (idum - xk * IQ) - IR * xk;
if(idum < 0)
{
idum += IM;
}
if(xj < NTAB)
{
iv[xj] = idum;
}
}
iy = iv[0];
}
xk = (idum) / IQ;
idum = IA * (idum - xk * IQ) - IR * xk;
if(idum < 0)
{
idum += IM;
}
xj = iy / NDIV;
iy = iv[xj];
iv[xj] = idum;
if((temp=float(AM*iy)) > RNMX)
{
return(float)(RNMX);
}
else
{
return(temp);
}
}
// end of bedlam function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -