[Webkit-unassigned] [Bug 44487] New: Clean up NumberPrototype.cpp

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 23 22:25:02 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=44487

           Summary: Clean up NumberPrototype.cpp
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: barraclough at apple.com


Number.toExponential/toFixed/toPrecision all contain a spaghetti of duplicated code & unnecessary complexity.
Add a new DecimalNumber class to encapsulate double to string conversion, share the implementations of rounding & decimal-fraction/exponential formatting.

This patch changes some layout test results - in all these cases we were not previously accurate to spec defined behaviour, and we are still not - but overall this changes reduces the overall magnitude of error due to rounding differences.  The underlying problem is that we should be using dtoa to generate results to a specified accuracy, rather than relying on pre-rounding the input values.  .  We should look at reenabling our dtoa implementation to work in this fashion as a separate change.

Up to 2x progression on mircobenchmarks of toFixed/toPrecision for small results with low precision.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list