2 回答

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超4個(gè)贊
計(jì)算機(jī)領(lǐng)域內(nèi)的整數(shù)(定點(diǎn)數(shù))和浮點(diǎn)數(shù)都只是一種對(duì)于數(shù)字的表示法,你可以理解成科學(xué)計(jì)數(shù)法的那種記法,所以也可以用浮點(diǎn)數(shù)表示法來表示一個(gè)整數(shù)。不要以為浮點(diǎn)數(shù)就一定是小數(shù)。

TA貢獻(xiàn)1830條經(jīng)驗(yàn) 獲得超3個(gè)贊
以下摘自ES6規(guī)范:
Math.clz32(x):When Math.clz32 is called with one argument x, the following steps are taken:
1. Let n be ToUint32(x).
2. Let p be the number of leading zero bits in the 32-bit binary representation of n.
3. Return p.
也就是說,Math.clz32( )會(huì)先把參數(shù)轉(zhuǎn)換為無符號(hào)32位的內(nèi)部表示,再返回前導(dǎo)0的個(gè)數(shù)。
- 2 回答
- 0 關(guān)注
- 610 瀏覽
添加回答
舉報(bào)