mirror of
https://github.com/reactos/reactos.git
synced 2025-05-28 05:28:14 +00:00
work around missing fpclassify
svn path=/trunk/; revision=39586
This commit is contained in:
parent
43659c9ace
commit
28c00b5c1c
1 changed files with 18 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue