亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JavaScript ?? ??

JavaScript Math ??

Math ??? JavaScript?? ???? ?? ??? ???? ? ?????.

String ? Date ??? ?? Math ??? ??? ???? ??? ??? Math()? ???? Math ??? ?? ??? ??? Math ??? ?? ??? ? ????. ????? Math ??? ???? ?? ?????? Math.function? ?? ?? ??? ? ????.

Math ?? ??

JavaScript? ????? ???? ?? ?? ?? ???? Math ??? 8?? ??? ?????.


?? e, ?? ?? Math? ?????. LN2 2? ?? ??(?? 0.693? ??)

Math.LN10 10? ?? ??(?? 2.302? ??)

Math.LOG2E ?? 2? e? ? ??(?? 1.414? ??)

Math .LOG10E ?? 10? ???? ? e? ??(?? 0.434? ??)

Math.PI Pi(?? 3.14159? ??)

Math.SQRT1_2 2? ???? ??(?? 0.707? ??)

Math .SQRT2 2? ???(?? 1.414? ??)

Math? ?? ??

Math ??? ? ??? ?? ??? ? ????.

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文網(wǎng)(php.cn)</title> 
<script type="text/javascript">
      var pi = Math.PI;
    document.write(pi);
</script>
</head>
<body>
</body>
</html>

? ??? ???? ??? ?? ?????.

3.14159265 3589793

?? ???


Math ???? ??? ? ?? ?? ? ??? ??? ? ?? ?? ??(???)? ????.

?? ???? Math ??? round ???? ???? ??? ??????.
document.write(Math.round(4.7));

? ??? ??? ??? ????.

5

?? ???? Math ??? random() ???? ???? ?? ?????. 0? 1 ??? ??? ?? ??:

document.write(Math.random());

? ??? ??? ??? ????.

0.897235837765038

?? ????? Math ??? Floor() ???? random()? ???? 0? 11 ??? ??? ?????.

document.write(Math.floor(Math.random ()* 11));

? ??? ??? ??? ????.

2

???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> <script type="text/javascript"> document.write( Math.round(Math.E) + "<br />" ); document.write(Math.round(0.3) + "<br />") document.write( Math.round(0.9) + "<br />" ); document.write( Math.round(-10.5) + "<br />" ); document.write( Math.round(10.5) ); </script> </head> <body> </body> </html>