• tkent@chromium.org's avatar
    2010-01-31 Kent Tamura <tkent@chromium.org> · 191b3814
    tkent@chromium.org authored
            Reviewed by Darin Adler.
    
            [Windows] Fix a bug of round() with huge integral numbers
            https://bugs.webkit.org/show_bug.cgi?id=34297
    
            Fix a bug that round() for huge integral numbers returns incorrect
            results. For example, round(8639999913600001) returns
            8639999913600002 without this change though the double type can
            represent 8639999913600001 precisely.
    
            Math.round() of JavaScript has a similar problem. But this change
            doesn't fix it because Math.round() doesn't use round() of
            MathExtra.h.
    
            * wtf/MathExtras.h:
            (round): Avoid to do "num + 0.5" or "num - 0.5".
            (roundf): Fixed similarly.
            (llround): Calls round().
            (llroundf): Calls roundf().
            (lround): Calls round().
            (lroundf): Calls roundf().
    
    2010-01-31  Kent Tamura  <tkent@chromium.org>
    
            Reviewed by Darin Adler.
    
            [Win] Fix a bug of round() with huge integral numbers
            https://bugs.webkit.org/show_bug.cgi?id=34297
    
            Add a test case to call round(8639999913600001).
    
            * fast/forms/input-valueasnumber-datetime-expected.txt:
            * fast/forms/script-tests/input-valueasnumber-datetime.js:
    
    git-svn-id: svn://svn.chromium.org/blink/trunk@54121 bbb929c8-8fbe-4397-9dbb-9b2b20218538
    191b3814
input-valueasnumber-datetime-expected.txt 2.22 KB