Commit a6e6863e authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Attempt a solution for the finite/isfinite/FINITE circus. (All callers

2002-10-11  Morten Welinder  <terra@diku.dk>

	* src/numbers.h (finitegnum): Attempt a solution for the
	finite/isfinite/FINITE circus.  (All callers should just use finitegnum.)

	* src/mathfunc.c (gpow2): Use ldexpgnum when available.
parent 8f338bf8
2002-10-11 Morten Welinder <terra@diku.dk>
* src/numbers.h (finitegnum): Attempt a solution for the
finite/isfinite/FINITE circus. (All callers should just use
finitegnum.)
* src/mathfunc.c (gpow2): Use ldexpgnum when available.
2002-10-10 Jody Goldberg <jody@gnome.org>
* src/expr-sheet.c (value_intersection) : move here and privatize.
......
2002-10-11 Morten Welinder <terra@diku.dk>
* src/numbers.h (finitegnum): Attempt a solution for the
finite/isfinite/FINITE circus. (All callers should just use
finitegnum.)
* src/mathfunc.c (gpow2): Use ldexpgnum when available.
2002-10-10 Jody Goldberg <jody@gnome.org>
* src/expr-sheet.c (value_intersection) : move here and privatize.
......
2002-10-11 Morten Welinder <terra@diku.dk>
* src/numbers.h (finitegnum): Attempt a solution for the
finite/isfinite/FINITE circus. (All callers should just use
finitegnum.)
* src/mathfunc.c (gpow2): Use ldexpgnum when available.
2002-10-10 Jody Goldberg <jody@gnome.org>
* src/expr-sheet.c (value_intersection) : move here and privatize.
......
......@@ -5768,8 +5768,10 @@ random_landau (void)
gnum_float
gpow2 (int n)
{
#ifdef NEED_FAKE_LDEXPGNUM
g_assert (FLT_RADIX == 2);
/* gpow2 is used in our implementation of ldexpgnum. */
if (n >= DBL_MIN_EXP && n <= DBL_MAX_EXP)
return (gnum_float) ldexp (1.0, n);
else if (n >= GNUM_MIN_EXP && n <= GNUM_MAX_EXP) {
......@@ -5785,6 +5787,9 @@ gpow2 (int n)
return res;
} else
return (n > 0) ? ML_POSINF : ML_UNDERFLOW;
#else
return ldexpgnum (1.0, n);
#endif
}
......
......@@ -5,19 +5,6 @@
#include <math.h>
#include <glib.h>
#ifndef FINITE
# if defined(HAVE_FINITE)
# ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
# endif
# define FINITE finite
# elif defined(HAVE_ISFINITE)
# define FINITE isfinite
# else
# error FINITE undefined
# endif
#endif
#ifdef qgamma
/* It was reported that mips-sgi-irix6.5 has a weird and conflicting define
for qgamma. See bug 1689. */
......
......@@ -139,7 +139,6 @@ typedef double gnum_float;
#define erfcgnum erfc
#define yngnum yn
#define isnangnum isnan
#define finitegnum finite
#define sinhgnum sinh
#define coshgnum cosh
#define tanhgnum tanh
......@@ -147,6 +146,16 @@ typedef double gnum_float;
#define acoshgnum acosh
#define atanhgnum atanh
/* What a circus! */
#ifdef HAVE_FINITE
#define finitegnum finite
#elif defined(HAVE_ISFINITE)
#define finitegnum isfinite
#elif defined(FINITE)
#define finitegnum FINITE
#error "I don't know an equivalent of finite for your system; you lose"
#endif
#define GNUM_FORMAT_e "e"
#define GNUM_FORMAT_E "E"
#define GNUM_FORMAT_f "f"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment