运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>JavaScript Math</h1> <h2>The Math .clz32() Method</h2> <p>Math.clz32() (short for CountLeadingZeroes32) returns the number of leading zeros in a 32-bit binary representation of a number:</p> <p id="demo"></p> <script> let a = Math.clz32(0); let b = Math.clz32(1); let c = Math.clz32(2); let d = Math.clz32(4); document.getElementById("demo").innerHTML = a + "<br>" + b + "<br>" + c + "<br>" + d; </script> </body> </html>