+2008-05-15 Ben Pfaff <blp@gnu.org>
+
+ Patch #6512.
+
+ * data-out.c (output_infinite): Use gsl_isnan instead of isnan,
+ and gsl_isinf instead of isinf, as a stopgap measure for
+ portability until appropriate gnulib modules are available.
+
+ * por-file-writer.c (format_trig_double): Similarly, use
+ gsl_finite instead of finite.
+
2008-03-18 John Darrington <john@darrington.wattle.id.au>
* data-in.c: If category is custom currency, then use
#include <ctype.h>
#include <float.h>
+#include <gsl/gsl_math.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
{
const char *s;
- if (isnan (number))
+ if (gsl_isnan (number))
s = "NaN";
- else if (isinf (number))
+ else if (gsl_isinf (number))
s = number > 0 ? "+Infinity" : "-Infinity";
else
s = "Unknown";
#include <ctype.h>
#include <errno.h>
#include <float.h>
+#include <gsl/gsl_math.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
0...30**6, an invariant of the loop below. */
errno = 0;
base_2_sig = frexp (value, &base_2_exp);
- if (errno != 0 || !finite (base_2_sig))
+ if (errno != 0 || !gsl_finite (base_2_sig))
goto missing_value;
if (base_2_exp == 0 && base_2_sig == 0.)
goto zero;
+2008-05-15 Ben Pfaff <blp@gnu.org>
+
+ Patch #6512.
+
+ * loop.c (loop_trns_proc): Use gsl_finite instead of finite, , as
+ a stopgap measure for portability until appropriate gnulib modules
+ are available.
+
2007-09-23 Ben Pfaff <blp@gnu.org>
Bug #21111. Reviewed by John Darrington.
#include <config.h>
#include "control-stack.h"
+
+#include <gsl/gsl_math.h>
+
#include <data/case.h>
#include <data/dictionary.h>
#include <data/procedure.h>
case_data_rw (c, loop->index_var)->f = loop->cur;
/* Throw out pathological cases. */
- if (!finite (loop->cur) || !finite (loop->by) || !finite (loop->last)
+ if (!gsl_finite (loop->cur) || !gsl_finite (loop->by)
+ || !gsl_finite (loop->last)
|| loop->by == 0.0
|| (loop->by > 0.0 && loop->cur > loop->last)
|| (loop->by < 0.0 && loop->cur < loop->last))
+2008-05-15 Ben Pfaff <blp@gnu.org>
+
+ Patch #6512.
+
+ * inpt-pgm.c (reread_trns_proc): Use gsl_finite instead of finite,
+ as a stopgap measure for portability until appropriate gnulib
+ modules are available.
+
2008-02-06 John Darrington <john@darrington.wattle.id.au>
* get-data.c: Add a /BSIZE subcommand to PSQL reader.
#include <language/data-io/inpt-pgm.h>
#include <float.h>
+#include <gsl/gsl_math.h>
#include <stdlib.h>
#include <data/case.h>
else
{
double column = expr_evaluate_num (t->column, c, case_num);
- if (!finite (column) || column < 1)
+ if (!gsl_finite (column) || column < 1)
{
msg (SE, _("REREAD: Column numbers must be positive finite "
"numbers. Column set to 1."));
+2008-05-15 Ben Pfaff <blp@gnu.org>
+
+ Patch #6512.
+
+ * evaluate.c (expr_evaluate): Use gsl_finite instead of finite, as
+ a stopgap measure for portability until appropriate gnulib modules
+ are available.
+
+ * helpers.h (copy_string): Ditto.
+
2007-10-12 Ben Pfaff <blp@gnu.org>
Patch #6224.
#include "private.h"
#include <ctype.h>
+#include <gsl/gsl_math.h>
#include <libpspp/assertion.h>
#include <libpspp/message.h>
#include "helpers.h"
break;
case OP_return_number:
- *(double *) result = finite (ns[-1]) ? ns[-1] : SYSMIS;
+ *(double *) result = gsl_finite (ns[-1]) ? ns[-1] : SYSMIS;
return;
case OP_return_string:
#include <ctype.h>
#include <float.h>
#include <gsl/gsl_cdf.h>
+#include <gsl/gsl_math.h>
#include <gsl/gsl_randist.h>
#include <gsl/gsl_sf.h>
#include <limits.h>
static inline bool
is_valid (double d)
{
- return finite (d) && d != SYSMIS;
+ return gsl_finite (d) && d != SYSMIS;
}
size_t count_valid (double *, size_t);
+2008-05-15 Ben Pfaff <blp@gnu.org>
+
+ Patch #6512.
+
+ * hash.c (hsh_hash_int): Use gsl_isnan instead of isnan, as a
+ stopgap measure for portability until appropriate gnulib modules
+ are available.
+
+ * misc.h (macro isinf): Remove implementations of isinf, isnan,
+ and finite, because they were not effective and we are now using
+ the equivalent GSL functions.
+
2008-03-04 Ben Pfaff <blp@gnu.org>
Patch #6427. Reviewed by John Darrington.
#include "message.h"
#include <assert.h>
#include <ctype.h>
+#include <gsl/gsl_math.h>
#include <limits.h>
#include <stdbool.h>
#include <stdlib.h>
unsigned
hsh_hash_double (double d)
{
- if (!isnan (d))
+ if (!gsl_isnan (d))
return hsh_hash_bytes (&d, sizeof d);
else
return 0;
#define EPSILON (10 * DBL_EPSILON)
-/* HUGE_VAL is traditionally defined as positive infinity, or
- alternatively, DBL_MAX. */
-#if !HAVE_ISINF && !defined isinf
-#define isinf(X) (fabs (X) == HUGE_VAL)
-#endif
-
-/* A Not a Number is not equal to itself. */
-#if !HAVE_ISNAN && !defined isnan
-#define isnan(X) ((X) != (X))
-#endif
-
-/* Finite numbers are not infinities or NaNs. */
-#if !HAVE_FINITE && !defined finite
-#define finite(X) (!isinf (X) && !isnan (X))
-#elif HAVE_IEEEFP_H
-#include <ieeefp.h> /* Declares finite() under Solaris. */
-#endif
-
/* Divides nonnegative X by positive Y, rounding up. */
#define DIV_RND_UP(X, Y) (((X) + ((Y) - 1)) / (Y))
+2008-05-15 Ben Pfaff <blp@gnu.org>
+
+ Patch #6512.
+
+ * moments.c (calc_moments): Use gsl_finite instead of finite, as a
+ stopgap measure for portability until appropriate gnulib modules
+ are available.
+
2008-03-10 Jason Stover <jhs@debs.hoobahooba.net>
* coefficient.c (pspp_linreg_get_coeff): Removed use of
#include <config.h>
#include "moments.h"
#include <assert.h>
+#include <gsl/gsl_math.h>
#include <math.h>
#include <stdlib.h>
#include <libpspp/misc.h>
{
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.)
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;
}
}