diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 01:28:00 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-10-22 01:28:00 +0000 |
commit | 03e88d8ac46156ac28d3ad14cd5025851cb15975 (patch) | |
tree | 3475fe7f783e96106c803fca0c28620dd27e9f2f /missing/erf.c | |
parent | cfeb22c3016f896ede986a9b80e8245b80c06fe4 (diff) | |
download | ruby-03e88d8ac46156ac28d3ad14cd5025851cb15975.tar.gz ruby-03e88d8ac46156ac28d3ad14cd5025851cb15975.tar.xz ruby-03e88d8ac46156ac28d3ad14cd5025851cb15975.zip |
* missing.h, missing/*.c: SUSv3 compatible strcasecmp and strncasecmp,
ANSI compatible strtol and strtoul, and ANSI styled other functions.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@9438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing/erf.c')
-rw-r--r-- | missing/erf.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/missing/erf.c b/missing/erf.c index d9e746902..fe65b9a47 100644 --- a/missing/erf.c +++ b/missing/erf.c @@ -25,8 +25,7 @@ static double q_gamma(double, double, double); /* Incomplete gamma function 1 / Gamma(a) * Int_0^x exp(-t) t^(a-1) dt */ -static double p_gamma(a, x, loggamma_a) - double a, x, loggamma_a; +static double p_gamma(double a, double x, double loggamma_a) { int k; double result, term, previous; @@ -45,8 +44,7 @@ static double p_gamma(a, x, loggamma_a) /* Incomplete gamma function 1 / Gamma(a) * Int_x^inf exp(-t) t^(a-1) dt */ -static double q_gamma(a, x, loggamma_a) - double a, x, loggamma_a; +static double q_gamma(double a, double x, double loggamma_a) { int k; double result, w, temp, previous; @@ -69,8 +67,7 @@ static double q_gamma(a, x, loggamma_a) #define LOG_PI_OVER_2 0.572364942924700087071713675675 /* log_e(PI)/2 */ -double erf(x) - double x; +double erf(double x) { if (!finite(x)) { if (isnan(x)) return x; /* erf(NaN) = NaN */ @@ -80,8 +77,7 @@ double erf(x) else return - p_gamma(0.5, x * x, LOG_PI_OVER_2); } -double erfc(x) - double x; +double erfc(double x) { if (!finite(x)) { if (isnan(x)) return x; /* erfc(NaN) = NaN */ |