Author: cwittich Date: Fri Feb 13 11:55:03 2009 New Revision: 39586
URL: http://svn.reactos.org/svn/reactos?rev=39586&view=rev Log: work around missing fpclassify
Modified: trunk/reactos/include/crt/math.h
Modified: trunk/reactos/include/crt/math.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/math.h?rev=3958... ============================================================================== --- trunk/reactos/include/crt/math.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/math.h [iso-8859-1] Fri Feb 13 11:55:03 2009 @@ -279,7 +279,24 @@ #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: