国产探花免费观看_亚洲丰满少妇自慰呻吟_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>            
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 深水埗区| 德昌县| 彭山县| 乌鲁木齐市| 专栏| 松原市| 麻城市| 平江县| 桦川县| 尼勒克县| 澄迈县| 南木林县| 永德县| 教育| 饶河县| 丰台区| 天台县| 凤山市| 台中县| 福泉市| 吕梁市| 尉犁县| 会同县| 理塘县| 卓资县| 将乐县| 平昌县| 阜城县| 拉萨市| 渝中区| 鹰潭市| 通化市| 大悟县| 凤阳县| 怀集县| 莎车县| 芒康县| 德兴市| 康乐县| 苍溪县| 岐山县|