国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

JavaScript常用數學函數用法示例

2024-05-06 15:34:14
字體:
來源:轉載
供稿:網友

本文實例講述了JavaScript常用數學函數用法。分享給大家供大家參考,具體如下:

一、代碼

<script language="javascript"><!--document.write("歐拉常數e的值為(e屬性):"+Math.E+"<br>");document.write("2的自然對數為(LN2屬性):"+Math.LN2+"<br>");//2的幾次方等于edocument.write("10的自然對數為(LN10屬性):"+Math.LN10+"<br>");//10的幾次方等于edocument.write("7的自然對數(log()方法):"+Math.log(7)+"<br>");//7的幾次方等于edocument.write("0的自然對數(log()方法):"+Math.log(0)+"<br>");document.write("-1的自然對數(log()方法):"+Math.log(-1)+"<br>");document.write("2的自然對數(log()方法):"+Math.log(2)+"<br>");//2的幾次方等于edocument.write("以2為基數的e的對數的值:"+Math.LOG2E+"<br>");//E的幾次方等于2document.write("以10為基數的e的對數的值:"+Math.LOG10E+"<br>");//E的幾次方等于10document.write(Math.SQRT1_2);//0.5的平方根document.write(Math.SQRT2);//2的平方根document.write("2的平方根:"+Math.sqrt(2)+"<br>");document.write("4的平方根:"+Math.sqrt(4)+"<br>");document.write("5的平方根:"+Math.sqrt(5)+"<br>");document.write("10的平方根:"+Math.sqrt(10));document.write("-2的絕對值:"+Math.abs(-2)+"<br>");document.write("0的絕對值:"+Math.abs(0)+"<br>");document.write("2的絕對值:"+Math.abs(2)+"<br>");document.write("2.7的絕對值:"+Math.abs(2.7)+"<br>");document.write("-2.7的絕對值:"+Math.abs(-2.7));document.write("1的正弦值:"+Math.sin(1)+"<br>");document.write("0的正弦值:"+Math.sin(0)+"<br>");document.write("-1的正弦值:"+Math.sin(-1)+"<br>");document.write("1的反正弦值的正弦值:"+Math.sin(Math.asin(1))+"<br>");document.write("1的余弦值:"+Math.cos(1)+"<br>");document.write("0的余弦值:"+Math.cos(0)+"<br>");document.write("-1的余弦值:"+Math.cos(-1)+"<br>");document.write("1的反余弦值的余弦值:"+Math.cos(Math.acos(1))+"<br>");document.write("1的正切值:"+Math.tan(1)+"<br>");document.write("0的正切值:"+Math.tan(0)+"<br>");document.write("-1的正切值:"+Math.tan(-1)+"<br>");document.write("1的反正切值的正切值:"+Math.tan(Math.atan(1))+"<br>");document.write("3和5中的最大數:"+Math.max(3,5)+"<br>");document.write("3和5中的最小數:"+Math.min(3,5)+"<br>");document.write("-3和5中的最大數:"+Math.max(-3,5)+"<br>");document.write("-3和5中的最小數:"+Math.min(-3,5)+"<br>");document.write("3.5和3.4中的最大數:"+Math.max(3.5,3.4)+"<br>");document.write("3.5和3.4中的最小數:"+Math.min(3.5,3.4));document.write("對7.5進行四舍五入:"+Math.round(7.5)+"<br>");document.write("對7.3進行四舍五入:"+Math.round(7.3)+"<br>");document.write("對-7.8進行四舍五入:"+Math.round(-7.8)+"<br>");document.write("對-7.3進行四舍五入:"+Math.round(-7.3));document.write("對7.7進行上舍入:"+Math.ceil(7.7)+"<br>");document.write("對7.3進行上舍入:"+Math.ceil(7.3)+"<br>");document.write("對-7.8進行上舍入:"+Math.ceil(-7.8)+"<br>");document.write("對-7.3進行上舍入:"+Math.ceil(-7.3));document.write("對7.7進行下舍入:"+Math.floor(7.7)+"<br>");document.write("對7.3進行下舍入:"+Math.floor(7.3)+"<br>");document.write("對-7.8進行下舍入:"+Math.floor(-7.8)+"<br>");document.write("對-7.3進行下舍入:"+Math.floor(-7.3));//--></script>            
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 义乌市| 奉节县| 邻水| 环江| 阿鲁科尔沁旗| 营山县| 迭部县| 峨山| 济宁市| 吴旗县| 和田县| 靖西县| 金堂县| 香港 | 安图县| 阿尔山市| 柘荣县| 云和县| 武安市| 纳雍县| 咸丰县| 法库县| 水富县| 山东省| 高陵县| 新巴尔虎左旗| 黄陵县| 洛浦县| 临潭县| 通城县| 读书| 卢氏县| 乌鲁木齐市| 武安市| 喀什市| 蕲春县| 琼结县| 图们市| 定西市| 北宁市| 新郑市|