JavaScript Tutorial/Math/LN10

Материал из Web эксперт
Перейти к: навигация, поиск

Math.LN10

The LN10 property of the Math object is used to get the natural logarithm of 10.

This is approximately equal to 2.302.



<html>
    <body>
    <script language="JavaScript">
    <!--
    function doMath(){
        var result = Math.LN10;
        document.form1.answer.value = result;
    }
    -->
    </script>
    <form name=form1>
    The Natural Logarithm of 10 is:
    <input type="text" name="answer" size=20>
    <input type="button" value="Calculate" onClick="doMath()">
    <br>
    </form>
    </body>
    </html>


The value of the natural Logarithm of 10: Math.LN10

<html>
<head>
<title>The Properties of the Math object</title>
<script type="text/javascript" language="javascript">
<!-- //
function DisplayMath(){
    document.write("<br/><P>The value of the natural Logarithm of 10 is: " + Math.LN10 + "</p>");
}
// -->
</script>
</head>
<body onload="DisplayMath()">
</body>
</html>