From: <de...@us...> - 2003-01-20 18:29:02
|
Update of /cvsroot/csp/APPLICATIONS/SimData/Source In directory sc8-pr-cvs1:/tmp/cvs-serv2790 Modified Files: Tag: simdata Random.cpp Log Message: no message Index: Random.cpp =================================================================== RCS file: /cvsroot/csp/APPLICATIONS/SimData/Source/Attic/Random.cpp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** Random.cpp 19 Jan 2003 20:31:41 -0000 1.1.2.1 --- Random.cpp 20 Jan 2003 18:28:59 -0000 1.1.2.2 *************** *** 38,43 **** */ float box_muller(float mean, float sigma) { ! float x1, x2, w, y1; ! static float y2; static int use_last = 0; if (use_last) { --- 38,43 ---- */ float box_muller(float mean, float sigma) { ! double x1, x2, w, y1; ! static double y2; static int use_last = 0; if (use_last) { *************** *** 56,60 **** use_last = 1; } ! return( mean + y1 * sigma ); } --- 56,60 ---- use_last = 1; } ! return static_cast<float>( mean + y1 * sigma ); } *************** *** 137,142 **** if (iy < 1) iy += IMM1; ! if ((temp = AM*iy) > RNMX) ! return RNMX; else return temp; --- 137,142 ---- if (iy < 1) iy += IMM1; ! if ((temp = static_cast<float>(AM*iy)) > RNMX) ! return static_cast<float>(RNMX); else return temp; *************** *** 154,159 **** */ float Gauss::box_muller(float mean, float sigma) { ! float x1, x2, w, y1; ! static float y2; static int use_last = 0; if (use_last) { --- 154,159 ---- */ float Gauss::box_muller(float mean, float sigma) { ! double x1, x2, w, y1; ! static double y2; static int use_last = 0; if (use_last) { *************** *** 172,176 **** use_last = 1; } ! return( mean + y1 * sigma ); } --- 172,176 ---- use_last = 1; } ! return static_cast<float>( mean + y1 * sigma ); } |