void gaussrand(float *gauss1, float *gauss2)
{
float x1,x2,w;
do {
x1 = crand();
x2 = crand();
w = x1 * x1 + x2 * x2;
} while ( w >= 1.0 );
w = sqrt( (-2.0 * logf(w) ) / w ); /// ????????????
*gauss1 = x1 * w;
*gauss2 = x2 * w;
}
c:\svn\ufoai\trunk\src\game\q_shared.c(382) : warning C4100: 'f' : unreferenced formal parameter
c:\svn\ufoai\trunk\src\game\q_shared.c(1217) : error C2143: syntax error : missing ')' before ';'
c:\svn\ufoai\trunk\src\game\q_shared.c(1217) : error C2143: syntax error : missing ';' before ')'
c:\svn\ufoai\trunk\src\game\q_shared.c(1217) : error C2059: syntax error : ')'
void gaussrand(float *gauss1, float *gauss2)
{
float x1,x2,w, f;
do {
x1 = crand();
x2 = crand();
w = x1 * x1 + x2 * x2;
} while ( w >= 1.0 );
f = logf(w);
w = sqrt( (-2.0 * f ) / w ); // !!!!!!!!!!!!!
*gauss1 = x1 * w;
*gauss2 = x2 * w;--------------------
}
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========