Technical support > Feature Requests

logf(w) ?? (vc8)

(1/1)

pleiades:

--- Code: ---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;
}

--- End code ---


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 : ')'


--- Code: ---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;--------------------
}
--- End code ---


========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

??????

Mattn:
please use code tags - which version are you using? what exactly is the problem here?

pleiades:
>>what exactly is the problem here?

Compile as C Code (/TC)

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 : ')'

Compile as C++ Code (/TP)
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

fixed....

Navigation

[0] Message Index

Go to full version