Ignore:
Timestamp:
Oct 27, 2007, 12:10:40 PM (18 years ago)
Author:
darin
Message:

Reviewed by Eric.

  • a couple of Windows fixes
  • wtf/MathExtras.h: (wtf_pow): Add a special case for MSVC, which has a "pow" function that does not properly handle the case where arg1 is NaN and arg2 is 0.
  • kjs/math_object.cpp: (MathFuncImp::callAsFunction): Don't explicity specify "::pow" -- just "pow" is fine.
  • wtf/ASCIICType.h: Check the compiler, not the OS, since it's the compiler/library that has the wchar_t that is just a typedef.
File:
1 edited

Legend:

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

    r27095 r27152  
    101101inline double wtf_fmod(double x, double y) { return (!isinf(x) && isinf(y)) ? x : fmod(x, y); }
    102102
    103 #define fmod(x, y) wtf_fmod(x, y)
     103// Work around a bug in the Microsoft CRT, where pow(NaN, 0) yields NaN instead of 1.
     104inline double wtf_pow(double x, double y) { return y == 0 ? 1 : pow(x, y); }
    104105
    105106#define atan2(x, y) wtf_atan2(x, y)
     107#define fmod(x, y) wtf_fmod(x, y)
     108#define pow(x, y) wtf_pow(x, y)
    106109
    107110#if defined(_CRT_RAND_S)
Note: See TracChangeset for help on using the changeset viewer.