Changeset 52302 in webkit


Ignore:
Timestamp:
Dec 17, 2009 11:17:12 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-17 Eric Seidel <eric@webkit.org>

Reviewed by Darin Adler.

HTMLInputElement::stepMismatch() uses ambiguous overload of pow()
https://bugs.webkit.org/show_bug.cgi?id=32675

Use the double constant 2.0 instead of static_cast<double>(2).

  • html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::stepMismatch):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r52300 r52302  
     12009-12-17  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        HTMLInputElement::stepMismatch() uses ambiguous overload of pow()
     6        https://bugs.webkit.org/show_bug.cgi?id=32675
     7
     8        Use the double constant 2.0 instead of static_cast<double>(2).
     9
     10        * html/HTMLInputElement.cpp:
     11        (WebCore::HTMLInputElement::stepMismatch):
     12
    1132009-12-17  Justin Schuh  <jschuh@chromium.org>
    214
  • trunk/WebCore/html/HTMLInputElement.cpp

    r52292 r52302  
    338338        // value is greater than step*2^DBL_MANT_DIG, the following fmod() makes
    339339        // no sense.
    340         if (doubleValue / pow(static_cast<double>(2), DBL_MANT_DIG) > step)
     340        if (doubleValue / pow(2.0, DBL_MANT_DIG) > step)
    341341            return false;
    342342        double remainder = fmod(doubleValue, step);
    343343        // Accepts errors in lower 7-bit.
    344         double acceptableError = step / pow(static_cast<double>(2), DBL_MANT_DIG - 7);
     344        double acceptableError = step / pow(2.0, DBL_MANT_DIG - 7);
    345345        return acceptableError < remainder && remainder < (step - acceptableError);
    346346    }
Note: See TracChangeset for help on using the changeset viewer.