W3School TIY Editor
W3School 在线教程
改变方向
暗黑模式
运行代码
<!DOCTYPE html> <html> <body> <h1>JavaScript 数学常量</h1> <p id="demo"></p> <script> document.getElementById("demo").innerHTML = "<p><b>Math.E:</b> " + Math.E + "</p>" + "<p><b>Math.PI:</b> " + Math.PI + "</p>" + "<p><b>Math.SQRT2:</b> " + Math.SQRT2 + "</p>" + "<p><b>Math.SQRT1_2:</b> " + Math.SQRT1_2 + "</p>" + "<p><b>Math.LN2:</b> " + Math.LN2 + "</p>" + "<p><b>Math.LN10:</b> " + Math.LN10 + "</p>" + "<p><b>Math.LOG2E:</b> " + Math.LOG2E + "</p>" + "<p><b>Math.Log10E:</b> " + Math.LOG10E + "</p>"; </script> </body> </html>