Home > Web Front-end > JS Tutorial > 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)

黄舟
Release: 2017-11-09 10:05:26
Original
4351 people have browsed it

Definition and usage

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

Syntax

Math.LN2
Copy after login

Examples

Return the natural logarithm of 2:

<script type="text/javascript">

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

</script>
Copy after login

Output:

LN2: 0.6931471805599453
Copy after login

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>
Copy after login

This will produce the following results:

Property Value is : 2.718281828459045
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template