|
|
log() JavaScript log function |
By using log() math function we can get log value of any number . Syntax is here
Math.log(x) ;
examples.
<script language='JavaScript' type='text/JavaScript'>
<!--
document.write(Math.log(2)); // Output is 0.6931471805599453
document.write("<br>");
document.write(Math.log(21)); // output is 3.044522437723423
document.write("<br>");
document.write(Math.log(2.5)); // output is 0.9162907318741551
document.write("<br>");
document.write(Math.log(-1.355)); // output is NaN
document.write("<br>");
document.write(Math.log(43-64)); // output is NaN
document.write("<br>");
//-->
</script>
Found anything wrong or wants to improve the code by adding more features? Post your short comment here or use the Forum
| |
| | |
|
|
|
|
|