roundTiesToEven

Jonathan Watt jwatt at jwatt.org
Sun Nov 11 04:04:10 PST 2007


Hi,

I've noticed that rounding in the reference implementation is implemented using
IEEE roundTiesToEven, but in browsers .5 values appear to round towards zero.
Although roundTiesToEven is desirable from a computational point of view,
there's likely a significant risk that changing to this method could break some
existing ECMAScript.

Math.round(1.5) === Math.round(2.5) // true in RI, false in browsers

Regards,
Jonathan




More information about the Es4-discuss mailing list