X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Ftukey%2Fqtukey.c;h=08f8c855d34c65ef50dabefb9f1c914490c3637b;hb=47ff0f73708c7c621093fa0a0500ca5e9cffa070;hp=08253df7546b4bb051cedc0e957b3215512e1d14;hpb=631e2243322503338b497cd13529fbb2c5833e3d;p=pspp diff --git a/lib/tukey/qtukey.c b/lib/tukey/qtukey.c index 08253df754..08f8c855d3 100644 --- a/lib/tukey/qtukey.c +++ b/lib/tukey/qtukey.c @@ -81,10 +81,8 @@ static double fmax2(double x, double y) { -#ifdef IEEE_754 - if (ISNAN(x) || ISNAN(y)) + if (isnan(x) || isnan(y)) return x + y; -#endif return (x < y) ? y : x; } @@ -188,15 +186,20 @@ double qtukey(double p, double rr, double cc, double df, double ans = 0.0, valx0, valx1, x0, x1, xabs; int iter; -#ifdef IEEE_754 - if (ISNAN(p) || ISNAN(rr) || ISNAN(cc) || ISNAN(df)) { - ML_ERROR(ME_DOMAIN, "qtukey"); + if (isnan(p) || isnan(rr) || isnan(cc) || isnan(df)) { + /* ML_ERROR(ME_DOMAIN, "qtukey"); */ return p + rr + cc + df; } -#endif /* df must be > 1 ; there must be at least two values */ - assert (! (df < 2 || rr < 1 || cc < 2) ); + /* ^^ + JMD: The comment says 1 but the code says 2. + Which is correct? + */ + assert (df >= 2); + assert (rr >= 1); + assert (cc >= 2); + R_Q_P01_boundaries (p, 0, ML_POSINF);