Jason Orendorff (2014-01-17T17:11:06.000Z)
On Fri, Jan 17, 2014 at 7:07 AM, Jens Nockert <jens at nockert.se> wrote:
> On 2014/01/17, at 13:24, Jason Orendorff <jason.orendorff at gmail.com> wrote:
>> 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.
>
> Yeah, but when would I need to calculate it on a floating-point number?

No one cares about fractions here; the question is about integer
values beyond 0xffffffff. These exist in the "safe integer" range of
JS numbers and will exist in future uint64 and bigint types. (Note
that the whole point of settling on bitlen, as opposed to clz32, would
be future compatibility with such types.)

-j
domenic at domenicdenicola.com (2014-01-24T19:55:57.509Z)
On Fri, Jan 17, 2014 at 7:07 AM, Jens Nockert <jens at nockert.se> wrote:

> Yeah, but when would I need to calculate it on a floating-point number?

No one cares about fractions here; the question is about integer
values beyond 0xffffffff. These exist in the "safe integer" range of
JS numbers and will exist in future uint64 and bigint types. (Note
that the whole point of settling on bitlen, as opposed to clz32, would
be future compatibility with such types.)