Languages
[Edit]
EN

JavaScript - Math.log() method example

9 points
Created by:
Root-ssh
178050

The Math.log() method returns the natural logarithm (base e) of a number. 

The Math.log() method is presented on the following chart:

Math.log(x) function visualization - JavaScript Math Object.
Math.log(x) function visualization - JavaScript Math Object.

1. Documentation

Edit
SyntaxMath.log(x)
Parametersx - integer or float number value in range 0 to +Infinitive (primitive value).
Result

number value calcualted as ln(x) mathematical function (primitive value).

If x is nagative it returns NaN.

If x is equal to 0 it returns -Infinity.

If x is equal to +Infinity it returns -Infinity.

Description

log is a static method that takes one parameter and returns an approximation of the ln(x) function (natural logarithm function - logarithm with base e).

2. Logarithm with custom base example

Edit

This example shows a logarithmic function calculation with own base.

3. Canvas plot example

Edit

References

Edit
  1. Natural logarithm - Wikipedia

Alternative titles

  1. JavaScript - Math.log() documentation with examples
  2. js - Math.log() method documentation with examples
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

JavaScript - Math documentation (EN)

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join