Math.round() fixes

Darin Adler darin at apple.com
Thu Sep 30 23:02:29 CEST 2004


On Sep 30, 2004, at 12:27 AM, Harri Porten wrote:

> here are some fixes for Math.round(). I see that the latest JSC 
> snapshot I
> have is just using ::floor(). This will probably miss out those cases
> tested in khtmltests/regression/tests/js/math.js.

Sorry that I didn't send a patch earlier. While fixing some bugs for 
the Mozilla JS tests, I changed the code to this:

    case MathObjectImp::Round:
        if (signbit(arg) && arg >= -0.5)
            result = -0.0;
        else
            result = ::floor(arg + 0.5);
        break;

    -- Darin



More information about the Khtml-devel mailing list