Changeset 17091 in webkit for trunk/JavaScriptCore/kjs/math_object.cpp
- Timestamp:
- Oct 17, 2006, 2:46:36 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/math_object.cpp
r17073 r17091 23 23 #include "math_object.h" 24 24 #include "math_object.lut.h" 25 #include "wtf/MathExtras.h" 25 26 26 27 #include "operations.h" 27 28 #include <math.h> 28 29 #include <time.h> 29 30 #if PLATFORM(WIN_OS)31 32 #include <float.h>33 static int signbit(double d)34 {35 // FIXME: Not sure if this is exactly right.36 switch (_fpclass(d)) {37 case _FPCLASS_NINF:38 case _FPCLASS_NN:39 case _FPCLASS_ND:40 case _FPCLASS_NZ:41 // It's one of wacky negatives, report as negative.42 return 1;43 case _FPCLASS_PINF:44 case _FPCLASS_PN:45 case _FPCLASS_PD:46 case _FPCLASS_PZ:47 // It's one of wacky positives, report as positive.48 return 0;49 default:50 return d < 0;51 }52 }53 54 #endif55 56 #ifndef M_PI57 #define M_PI 3.1415926535897932384658 #endif /* M_PI */59 30 60 31 using namespace KJS; … … 227 198 else if (isNaN(arg) && arg2 != 0) 228 199 result = NaN; 229 else if (fabs(arg) == 1 && KJS::isInf(arg2))200 else if (fabs(arg) == 1 && isInf(arg2)) 230 201 result = NaN; 202 else if (arg2 == 0 && arg != 0) 203 result = 1; 231 204 else 232 result = pow(arg, arg2);205 result = ::pow(arg, arg2); 233 206 break; 234 207 case MathObjectImp::Random:
Note:
See TracChangeset
for help on using the changeset viewer.