diff --git a/src/platform.h b/src/platform.h index 662d51e40..fba2078bb 100644 --- a/src/platform.h +++ b/src/platform.h @@ -21,7 +21,6 @@ #pragma warning(disable: 4457) // declaration hides function parameter #pragma warning(disable: 4459) // declaration hides global #else /* assume gcc */ -#define __USE_BSD #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L # define va_copy(a,b) __va_copy(a,b) #endif diff --git a/src/util/rand.c b/src/util/rand.c index a4ee7acb5..bd8543b9e 100644 --- a/src/util/rand.c +++ b/src/util/rand.c @@ -28,6 +28,8 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#define PI_L 3.1415926535897932384626433832795L + int lovar(double xpct_x2) { int n = (int)(xpct_x2 * 500) + 1; @@ -49,10 +51,10 @@ double normalvariate(double mu, double sigma) if (phase == 0) { U = (rng_int() + 1.) / (RNG_RAND_MAX + 2.); V = rng_int() / (RNG_RAND_MAX + 1.); - Z = sqrt(-2 * log(U)) * sin(2 * M_PI * V); + Z = sqrt(-2 * log(U)) * sin(2 * PI_L * V); } else { - Z = sqrt(-2 * log(U)) * cos(2 * M_PI * V); + Z = sqrt(-2 * log(U)) * cos(2 * PI_L * V); } phase = 1 - phase;