avoid troublesome extended-precision floating-point arithmetic
svn: r10115
This commit is contained in:
parent
f922f37bf6
commit
2cb1d61d9f
|
@ -7,7 +7,7 @@ START_XFORM_SKIP;
|
||||||
extended format instead of a `double'. We don't want to turn off
|
extended format instead of a `double'. We don't want to turn off
|
||||||
floatng-point optimizations in the rest of the program, so we use a
|
floatng-point optimizations in the rest of the program, so we use a
|
||||||
little function to defeat the optimization: */
|
little function to defeat the optimization: */
|
||||||
static int IS_FLOAT_INF(FP_TYPE d)
|
int IS_FLOAT_INF(FP_TYPE d)
|
||||||
{
|
{
|
||||||
return MZ_IS_POS_INFINITY(d);
|
return MZ_IS_POS_INFINITY(d);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1392,7 +1392,7 @@ static void bignum_add1_inplace(Scheme_Object **_stk_o)
|
||||||
|
|
||||||
#define USE_FLOAT_BITS 53
|
#define USE_FLOAT_BITS 53
|
||||||
#define FP_TYPE double
|
#define FP_TYPE double
|
||||||
#define IS_FLOAT_INF is_double_inf
|
#define IS_FLOAT_INF scheme__is_double_inf
|
||||||
#define SCHEME_BIGNUM_TO_FLOAT_INFO scheme_bignum_to_double_inf_info
|
#define SCHEME_BIGNUM_TO_FLOAT_INFO scheme_bignum_to_double_inf_info
|
||||||
#define SCHEME_BIGNUM_TO_FLOAT scheme_bignum_to_double
|
#define SCHEME_BIGNUM_TO_FLOAT scheme_bignum_to_double
|
||||||
#define SCHEME_CHECK_FLOAT scheme_check_double
|
#define SCHEME_CHECK_FLOAT scheme_check_double
|
||||||
|
@ -1410,7 +1410,7 @@ static void bignum_add1_inplace(Scheme_Object **_stk_o)
|
||||||
|
|
||||||
# define USE_FLOAT_BITS 24
|
# define USE_FLOAT_BITS 24
|
||||||
# define FP_TYPE float
|
# define FP_TYPE float
|
||||||
# define IS_FLOAT_INF is_float_inf
|
# define IS_FLOAT_INF scheme__is_float_inf
|
||||||
# define SCHEME_BIGNUM_TO_FLOAT_INFO scheme_bignum_to_float_inf_info
|
# define SCHEME_BIGNUM_TO_FLOAT_INFO scheme_bignum_to_float_inf_info
|
||||||
# define SCHEME_BIGNUM_TO_FLOAT scheme_bignum_to_float
|
# define SCHEME_BIGNUM_TO_FLOAT scheme_bignum_to_float
|
||||||
# define SCHEME_CHECK_FLOAT scheme_check_float
|
# define SCHEME_CHECK_FLOAT scheme_check_float
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
floatng-point optimizations in the rest of the program, so we use a
|
floatng-point optimizations in the rest of the program, so we use a
|
||||||
little function to defeat the optimization: */
|
little function to defeat the optimization: */
|
||||||
|
|
||||||
static FP_TYPE DO_FLOAT_DIV(FP_TYPE n, FP_TYPE d)
|
FP_TYPE DO_FLOAT_DIV(FP_TYPE n, FP_TYPE d)
|
||||||
{
|
{
|
||||||
return n / d;
|
return n / d;
|
||||||
}
|
}
|
||||||
|
|
|
@ -527,7 +527,7 @@ Scheme_Object *scheme_rational_sqrt(const Scheme_Object *o)
|
||||||
#define SCHEME_BIGNUM_TO_FLOAT_INF_INFO scheme_bignum_to_double_inf_info
|
#define SCHEME_BIGNUM_TO_FLOAT_INF_INFO scheme_bignum_to_double_inf_info
|
||||||
#define SCHEME_CHECK_FLOAT scheme_check_double
|
#define SCHEME_CHECK_FLOAT scheme_check_double
|
||||||
#define SCHEME_BIGNUM_FROM_FLOAT scheme_bignum_from_double
|
#define SCHEME_BIGNUM_FROM_FLOAT scheme_bignum_from_double
|
||||||
#define DO_FLOAT_DIV do_double_div
|
#define DO_FLOAT_DIV scheme__do_double_div
|
||||||
#define FLOAT_E_MIN -1074
|
#define FLOAT_E_MIN -1074
|
||||||
#define FLOAT_M_BITS 52
|
#define FLOAT_M_BITS 52
|
||||||
#include "ratfloat.inc"
|
#include "ratfloat.inc"
|
||||||
|
@ -549,7 +549,7 @@ Scheme_Object *scheme_rational_sqrt(const Scheme_Object *o)
|
||||||
#define SCHEME_BIGNUM_TO_FLOAT_INF_INFO scheme_bignum_to_float_inf_info
|
#define SCHEME_BIGNUM_TO_FLOAT_INF_INFO scheme_bignum_to_float_inf_info
|
||||||
#define SCHEME_CHECK_FLOAT scheme_check_float
|
#define SCHEME_CHECK_FLOAT scheme_check_float
|
||||||
#define SCHEME_BIGNUM_FROM_FLOAT scheme_bignum_from_float
|
#define SCHEME_BIGNUM_FROM_FLOAT scheme_bignum_from_float
|
||||||
#define DO_FLOAT_DIV do_float_div
|
#define DO_FLOAT_DIV scheme__do_float_div
|
||||||
#define FLOAT_E_MIN -127
|
#define FLOAT_E_MIN -127
|
||||||
#define FLOAT_M_BITS 23
|
#define FLOAT_M_BITS 23
|
||||||
#include "ratfloat.inc"
|
#include "ratfloat.inc"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user