From 28c00b5c1c0de1454432df81c2adc56cc16fcc1f Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Fri, 13 Feb 2009 17:55:03 +0000 Subject: [PATCH] work around missing fpclassify svn path=/trunk/; revision=39586 --- reactos/include/crt/math.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/reactos/include/crt/math.h b/reactos/include/crt/math.h index da6756f5b7c..3652be786a9 100644 --- a/reactos/include/crt/math.h +++ b/reactos/include/crt/math.h @@ -279,7 +279,24 @@ extern "C" { #define isfinite(x) ((fpclassify(x) & FP_NAN) == 0) /* 7.12.3.3 */ -#define isinf(x) (fpclassify(x) == FP_INFINITE) +/* #define isinf(x) (fpclassify(x) == FP_INFINITE) */ + + /* we don't have fpclassify */ +static int isinf (double d) { + int expon = 0; + double val = frexp (d, &expon); + if (expon == 1025) { + if (val == 0.5) { + return 1; + } else if (val == -0.5) { + return -1; + } else { + return 0; + } + } else { + return 0; + } +} /* 7.12.3.4 */ /* We don't need to worry about trucation here: