archives

« Bugzilla Issues Index

#1807 — better wording for Math.roundFloat32


The spec for Math.roundFloat32 refers to IEEE-868-2005 which I've never heard of, and I can't find any evidence of its existence on Google or the IEEE web site. :) I assume you meant IEEE-754-2008. But the rest of the spec simply refers to it as IEEE 754, so for consistency I'd use that wording.

Here's how I would write the steps:

* If x is NaN, return NaN.
* If x is one of -0, 0, +∞, -∞, the return x.
* Let x32 be the result of converting x to a value in IEEE 754 single-precision 32-bit binary format using roundTiesToEven.
* Let x64 be the result of converting x32 to a value in IEEE 754 double-precision 64-bit binary format.
* Return the ECMAScript number corresponding to x64.

Dave


fixed in rev19 editor's draft


fixed in rev19