Use gsl_isnan instead of isnan, gsl_isinf instead of isinf, and
[pspp-builds.git] / src / math / moments.c
index 084e6d8c8b22f24c469212fec682080c204da6d9..02208bca70d007d1bc9f61f07d518b9b985a621d 100644 (file)
@@ -17,6 +17,7 @@
 #include <config.h>
 #include "moments.h"
 #include <assert.h>
+#include <gsl/gsl_math.h>
 #include <math.h>
 #include <stdlib.h>
 #include <libpspp/misc.h>
@@ -55,7 +56,7 @@ calc_moments (enum moment max_moment,
             {
               double s3 = s2 * sqrt (s2);
               double g1 = (w * d3) / ((w - 1.0) * (w - 2.0) * s3);
-              if (finite (g1))
+              if (gsl_finite (g1))
                 *skewness = g1;
             }
           if (max_moment >= MOMENT_KURTOSIS && kurtosis != NULL && w > 3.)
@@ -63,7 +64,7 @@ calc_moments (enum moment max_moment,
               double den = (w - 2.) * (w - 3.) * pow2 (s2);
               double g2 = (w * (w + 1) * d4 / (w - 1.) / den
                            - 3. * pow2 (d2) / den);
-              if (finite (g2))
+              if (gsl_finite (g2))
                 *kurtosis = g2;
             }
         }