JavaScript Math對象方法

來源:互聯網
上載者:User

標籤:post   asc   返回   floor   javascrip   div   span   cos   mat   

 1    console.log(Math.abs(123));//絕對值 2  3     console.log(Math.ceil(123.3));//向上舍入 4  5     console.log(Math.floor(123));//向下舍入 6  7     console.log(Math.max(x,y));//x,y中最高值 8  9     console.log(Math.min(123));//x,y中最低值10 11     console.log(Math.pow(x,y));//x的y次冪12 13     console.log(Math.random());//0~1的隨機數14 15     console.log(Math.sqrt(x));//數的平方根16 17     console.log(Math.round(x));//數四捨五入為最接近的整數18 19     console.log(Math.acos(x));//返回數的反餘弦值。20 21     console.log(Math.asin(x));//返回數的反正弦值。22 23     console.log(Math.sin(x));//返回數的正弦。24 25     console.log(Math.tan(x));//返回角的正切。26 27     console.log(Math.toSource(x));//返回該對象的原始碼。28 29     console.log(Math.log(x));//返回數的自然對數(底為e)。

 

JavaScript Math對象方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.