Skip to content
Subhajit Sahu edited this page Aug 8, 2022 · 2 revisions

Find the logarithm of a number with a given base.


function log(x, b?)
// x: a number
// b: logarithm base [e]

const xmath = require('extra-math');


xmath.log(Math.E);
// → 1

xmath.log(10);
// → 2.302585092994046

xmath.log(243, 3);
// → 5

xmath.log(64, 2);
// → 6


References

Clone this wiki locally