172. implement `Math.clz32()`

JavaScript

medium  - accepted / - tried

Math.clz32() returns the number of leading zero bits in the 32-bit binary representation of a number.

Let's try to implement it by ourselves.

clz32(1) // 31
clz32(10000) // 18
clz32(25.45) // 27

Bugfree ordinary solution is better than buggy fancy ones.

(14)