Number(0.0001234567890123456789012345).toPrecision(20) returns 0.00012345678901234565000 Number(0.0001234567890123456789012345).toPrecision(21) also returns 0.000123456789012345650000 Tests failing: fast/js/kde/Number.html The problem is that, due to the compiler or FPU or what have you, 1.000000...e+22 * 10.0 is returning 9.999...92e+22 rather than 1.000000...e+23, so intPow10() in kjs/number_object.cpp is wrong and so is toPrecision(). For reference, IE7 gets the result right, and Firefox 2 gives a different wrong answer (0.00012345678901234567130). A couple of other numerical algorithms I tried give the same erroneous result. Special-casing 1e+22 is just ugly. I'm tempted to add a precision argument to UString::from(double) and use its string manipulations instead. :/ Any other suggestions?
Confirmed on the latest Webkit on Windows.
*** This bug has been marked as a duplicate of bug 44745 ***