Ignore:
Timestamp:
Nov 6, 2008, 10:03:31 AM (17 years ago)
Author:
Simon Hausmann
Message:

2008-11-06 Laszlo Gombos <Laszlo Gombos>

Reviewed by Simon Hausmann.

Borrow some math functions from the MSVC port to the build with the
RVCT compiler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/MathExtras.h

    r37498 r38177  
    101101#endif
    102102
    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
    107105inline long lround(double num) { return static_cast<long>(num > 0 ? num + 0.5 : ceil(num - 0.5)); }
    108106inline long lroundf(float num) { return static_cast<long>(num > 0 ? num + 0.5f : ceilf(num - 0.5f)); }
    109107inline double round(double num) { return num > 0 ? floor(num + 0.5) : ceil(num - 0.5); }
    110108inline float roundf(float num) { return num > 0 ? floorf(num + 0.5f) : ceilf(num - 0.5f); }
     109inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); }
     110
     111#endif
     112
     113#if COMPILER(MSVC)
     114
     115inline bool isinf(double num) { return !_finite(num) && !_isnan(num); }
     116inline bool isnan(double num) { return !!_isnan(num); }
    111117inline bool signbit(double num) { return _copysign(1.0, num) < 0; }
    112 inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); }
    113118
    114119inline double nextafter(double x, double y) { return _nextafter(x, y); }
Note: See TracChangeset for help on using the changeset viewer.