Logarithm of a BigInt
In case you don’t want to return a BigInt, then the following might work for you too: function log10(bigint) { if (bigint < 0) return NaN; const s = bigint.toString(10); return s.length + Math.log10(“0.” + s.substring(0, 15)) } function log(bigint) { return log10(bigint) * Math.log(10); } function natlog(bigint) { if (bigint < 0) return NaN; … Read more