Changeset 96780 in webkit for trunk/Source/JavaScriptCore/wtf


Ignore:
Timestamp:
Oct 5, 2011, 7:04:19 PM (14 years ago)
Author:
[email protected]
Message:

Define a log2f() function for Windows in wtf/MathExtras.h
https://bugs.webkit.org/show_bug.cgi?id=69491

Reviewed by Darin Adler.

Source/JavaScriptCore:

  • wtf/MathExtras.h:

(log2f):

Source/WebCore:

No new tests. This change is tested in existing layout tests.

  • webaudio/AudioParamTimeline.cpp:

(WebCore::AudioParamTimeline::valuesForTimeRangeImpl):

File:
1 edited

Legend:

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

    r95555 r96780  
    150150inline int isfinite(double x) { return _finite(x); }
    151151
    152 // MSVC's math.h does not currently supply log2.
     152// MSVC's math.h does not currently supply log2 or log2f.
    153153inline double log2(double num)
    154154{
    155155    // This constant is roughly M_LN2, which is not provided by default on Windows.
    156156    return log(num) / 0.693147180559945309417232121458176568;
     157}
     158
     159inline float log2f(float num)
     160{
     161    // This constant is roughly M_LN2, which is not provided by default on Windows.
     162    return logf(num) / 0.693147180559945309417232121458176568f;
    157163}
    158164
Note: See TracChangeset for help on using the changeset viewer.