project-navigation
Personal tools

Author Topic: logf(w) ?? (vc8)  (Read 2493 times)

pleiades

  • Guest
logf(w) ?? (vc8)
« on: September 27, 2006, 07:51:22 pm »
Code: [Select]
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 : ')'

Code: [Select]
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 ==========

??????

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
logf(w) ?? (vc8)
« Reply #1 on: September 27, 2006, 08:43:50 pm »
please use code tags - which version are you using? what exactly is the problem here?

pleiades

  • Guest
logf(w) ?? (vc8)
« Reply #2 on: September 28, 2006, 08:15:35 pm »
>>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....