Home  >  Article  >  Web Front-end  >  JavaScript returns the property LN2 of the natural logarithm of 2 (approximately equal to 0.693)

JavaScript returns the property LN2 of the natural logarithm of 2 (approximately equal to 0.693)

黄舟
黄舟Original
2017-11-09 10:05:264341browse

Definition and usage

LN2 Attribute is loge2, which is the natural logarithm of 2, and its value is approximately 0.69314718055994528623.

Syntax

Math.LN2

Examples

Return the natural logarithm of 2:

<script type="text/javascript">

document.write("LN2: " + Math.LN2);

</script>

Output:

LN2: 0.6931471805599453

Example:

<html>
<head>
<title>JavaScript Math E Property</title>
</head>
<body>
<script type="text/javascript">
  var property_value = Math.E
  document.write("Property Value is : " + property_value); 
</script>
</body>
</html>

This will produce the following results:

Property Value is : 2.718281828459045

The above is the detailed content of JavaScript returns the property LN2 of the natural logarithm of 2 (approximately equal to 0.693). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn