Changeset 27201 in webkit for trunk/JavaScriptCore/kjs/operations.cpp
- Timestamp:
- Oct 28, 2007, 7:52:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/operations.cpp
r26961 r27201 29 29 #include <wtf/MathExtras.h> 30 30 31 #if HAVE(FUNC_ISINF) && HAVE(IEEEFP_H)32 #include <ieeefp.h>33 #endif34 35 31 #if HAVE(FLOAT_H) 36 32 #include <float.h> … … 38 34 39 35 namespace KJS { 40 41 #if !PLATFORM(DARWIN)42 43 // FIXME: Should probably be inlined on non-Darwin platforms too, and controlled exclusively44 // by HAVE macros rather than PLATFORM.45 46 // FIXME: Merge with isnan in MathExtras.h and remove this one entirely.47 bool isNaN(double d)48 {49 #if HAVE(FUNC_ISNAN)50 return isnan(d);51 #elif HAVE(FLOAT_H)52 return _isnan(d) != 0;53 #else54 return !(d == d);55 #endif56 }57 58 // FIXME: Merge with isinf in MathExtras.h and remove this one entirely.59 bool isInf(double d)60 {61 // FIXME: should be HAVE(_FPCLASS)62 #if PLATFORM(WIN_OS)63 int fpClass = _fpclass(d);64 return _FPCLASS_PINF == fpClass || _FPCLASS_NINF == fpClass;65 #elif HAVE(FUNC_ISINF)66 return isinf(d);67 #elif HAVE(FUNC_FINITE)68 return finite(d) == 0 && d == d;69 #elif HAVE(FUNC__FINITE)70 return _finite(d) == 0 && d == d;71 #else72 return false;73 #endif74 }75 76 bool isPosInf(double d)77 {78 // FIXME: should be HAVE(_FPCLASS)79 #if PLATFORM(WIN_OS)80 return _FPCLASS_PINF == _fpclass(d);81 #elif HAVE(FUNC_ISINF)82 return (isinf(d) == 1);83 #elif HAVE(FUNC_FINITE)84 return !finite(d) && d == d; // ### can we distinguish between + and - ?85 #elif HAVE(FUNC__FINITE)86 return !_finite(d) && d == d; // ###87 #else88 return false;89 #endif90 }91 92 bool isNegInf(double d)93 {94 // FIXME: should be HAVE(_FPCLASS)95 #if PLATFORM(WIN_OS)96 return _FPCLASS_NINF == _fpclass(d);97 #elif HAVE(FUNC_ISINF)98 return (isinf(d) == -1);99 #elif HAVE(FUNC_FINITE)100 return finite(d) == 0 && d == d; // ###101 #elif HAVE(FUNC__FINITE)102 return _finite(d) == 0 && d == d; // ###103 #else104 return false;105 #endif106 }107 108 #endif109 36 110 37 // ECMA 11.9.3
Note:
See TracChangeset
for help on using the changeset viewer.