Gistlib Logo

gistlib

natural log in javascript

index.tsx
// To find natural log (base e) of a number in JavaScript:
let number = 10;
let result = Math.log(number);

console.log(result);  // will output approximately 2.302585092994046
177 chars
6 lines

similar javascript code snippets

find the largest number in the following list of numbers: [1, 3, 4, 2, 5] in javascript
calculate pi plus infinity in javascript
find the median of all elements in an array in javascript
find the sum of all elements in an array in javascript
calculate pi in javascript
find the average of all elements in an array in javascript
find the range of all elements in an array in javascript
find the mode of all elements in an array in javascript
pick string1 or string2 at random in javascript
number of digits in javascript

related categories

javascript
math

gistlibby LogSnag