Changeset 38177 in webkit for trunk/JavaScriptCore/wtf/MathExtras.h
- Timestamp:
- Nov 6, 2008, 10:03:31 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/MathExtras.h
r37498 r38177 101 101 #endif 102 102 103 #if COMPILER(MSVC) 104 105 inline bool isinf(double num) { return !_finite(num) && !_isnan(num); } 106 inline bool isnan(double num) { return !!_isnan(num); } 103 #if COMPILER(MSVC) || COMPILER(RVCT) 104 107 105 inline long lround(double num) { return static_cast<long>(num > 0 ? num + 0.5 : ceil(num - 0.5)); } 108 106 inline long lroundf(float num) { return static_cast<long>(num > 0 ? num + 0.5f : ceilf(num - 0.5f)); } 109 107 inline double round(double num) { return num > 0 ? floor(num + 0.5) : ceil(num - 0.5); } 110 108 inline float roundf(float num) { return num > 0 ? floorf(num + 0.5f) : ceilf(num - 0.5f); } 109 inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); } 110 111 #endif 112 113 #if COMPILER(MSVC) 114 115 inline bool isinf(double num) { return !_finite(num) && !_isnan(num); } 116 inline bool isnan(double num) { return !!_isnan(num); } 111 117 inline bool signbit(double num) { return _copysign(1.0, num) < 0; } 112 inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); }113 118 114 119 inline double nextafter(double x, double y) { return _nextafter(x, y); }
Note:
See TracChangeset
for help on using the changeset viewer.