log - nodef/extra-math GitHub Wiki

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