久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      javascript怎么進行求冪運算

      javascript進行求冪運算的方法:1、利用Math對象的pow()方法,語法“Math.pow(n, m)”,可返回n的m次冪的值;2、利用求冪運算符“**”,語法“x ** y”,可返回x的y次冪的值。

      javascript怎么進行求冪運算

      本教程操作環(huán)境:windows7系統(tǒng)、javascript1.8.5版、Dell G3電腦。

      求冪運算

      冪(power)是指數(shù)運算的結(jié)果。當m為正整數(shù)時,n?指該式意義為m個n相乘。當m為小數(shù)時,m可以寫成a/b(其中a、b為整數(shù)),n?表示n?再開b次根號。

      當m為虛數(shù)時,則需要利用歐拉公式 eiθ=cosθ+isinθ,再利用對數(shù)性質(zhì)求解。

      把n?看作乘方的結(jié)果,叫做n的m次冪,也叫n的m次方。

      javascript怎么進行求冪運算

      方法1:使用pow()方法

      pow() 方法可返回 n 的 m 次冪 (n?) 的值。如果結(jié)果是虛數(shù)或負數(shù),則該方法將返回 NaN。如果由于指數(shù)過大而引起浮點溢出,則該方法將返回 Infinity。

      示例:返回 4 的 3 次冪 (4*4*4) 的值

      console.log(Math.pow(4, 3));

      javascript怎么進行求冪運算

      方法2:使用求冪運算符(**

      求冪運算符(**)返回第一個操作數(shù)做底數(shù),第二個操作數(shù)做指數(shù)的乘方。它等效于Math.pow,不同之處在于它也接受BigInts作為操作數(shù)。

      console.log(3 ** 4); // expected output: 81  console.log(10 ** -2); // expected output: 0.01  console.log(2 ** 3 ** 2); // expected output: 512  console.log((2 ** 3) ** 2); // expected output: 64

      javascript怎么進行求冪運算

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號