Changeset 10510 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Sep 10, 2005, 11:24:44 AM (20 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/internal.cpp
r10456 r10510 264 264 return (double)uint32 == val; 265 265 } 266 267 double SimpleNumber::negZero = -0.0;268 266 269 267 // ------------------------------ LabelStack ----------------------------------- -
trunk/JavaScriptCore/kjs/simple_number.h
r9768 r10510 1 // -*- c-basic-offset: 2 -*-2 1 /* 3 2 * This file is part of the KDE libraries … … 21 20 */ 22 21 23 #ifndef _KJS_SIMPLE_NUMBER_H_24 #define _KJS_SIMPLE_NUMBER_H_22 #ifndef KJS_SIMPLE_NUMBER_H 23 #define KJS_SIMPLE_NUMBER_H 25 24 25 #include <float.h> 26 26 #include <math.h> 27 27 #include <string.h> 28 28 29 #define IS_NEGATIVE_ZERO(num) (num == 0.0 && !memcmp(&num, &SimpleNumber::negZero, sizeof(double))) 29 namespace KJS { 30 30 31 namespace KJS {32 31 class ValueImp; 33 32 33 inline bool isNegativeZero(double num) 34 { 35 #if WIN32 36 return _fpclass(num) == _FPCLASS_NZ; 37 #else 38 return num == -0.0 && signbit(num); 39 #endif 40 } 41 34 42 class SimpleNumber { 35 43 public: … … 44 52 static inline bool fits(unsigned long i) { return i <= (unsigned)max; } 45 53 static inline bool integerFits(double d) { return !(d < min || d > max); } 46 static inline bool fits(double d) { return d >= min && d <= max && d == (double)(long)d && ! IS_NEGATIVE_ZERO(d); }54 static inline bool fits(double d) { return d >= min && d <= max && d == (double)(long)d && !isNegativeZero(d); } 47 55 static inline ValueImp *make(long i) { return (ValueImp *)((i << shift) | tag); } 56 }; 48 57 49 static double negZero;50 };51 58 } 52 59 -
trunk/JavaScriptCore/kjs/value.cpp
r10084 r10510 46 46 AllocatedValueImp *ConstantValues::NaN = NULL; 47 47 48 static const double D16 = 65536 ;48 static const double D16 = 65536.0; 49 49 static const double D32 = 4294967296.0; 50 50
Note:
See TracChangeset
for help on using the changeset viewer.