Rename Number.prototype.clz to Math.clz

Jason Orendorff jason.orendorff at gmail.com
Fri Jan 17 04:24:53 PST 2014


On Fri, Jan 17, 2014 at 6:12 AM, Jens Nockert <jens at nockert.se> wrote:
> When I needed this function the last time (implementing audio codecs in JS) I would have needed that it worked essentially like the bitwise operators, and defined on the resulting 32-bit signed int.

Then you could write: Math.bitlen(x >>> 0)

That would return 32 if x is a negative 32-bit signed int, because
">>> 0" converts ToUint32.

-j


More information about the es-discuss mailing list