JavaScript log10() method
- Forrige side log()
- Næste side log1p()
- Gå tilbage til forrige niveau JavaScript Math Reference Håndbog
Definition and usage
log10()
The method returns the logarithm of the number with base 10.
Instance
Example 1
Return the logarithm of the number "2" with base 10:
Math.log10(2);
Example 2
Use the log10() method for different numbers:
var a = Math.log10(2.7183); var b = Math.log10(2); var c = Math.log10(1); var d = Math.log10(0); var e = Math.log10(-1);
Syntax
Math.log10(x)
Parameter value
Parameter | Description |
---|---|
x | Required. Number. |
Technical details
Return value: |
A number representing the logarithm of the number with base 10
|
---|---|
JavaScript version: | ECMAScript 2015 |
Browserstøtte
Metoder | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
log10() | 38.0 | 12.0 | 25.0 | 8.0 | 25.0 |
Relaterede sider
Tilrettelæggelse:JavaScript matematik
- Forrige side log()
- Næste side log1p()
- Gå tilbage til forrige niveau JavaScript Math Reference Håndbog