Menu

gitpiper

logBase javascript Code Snippet in 2024

mathbeginner

Last Updated: 14 December 2024

Calculates the logarithm of the given number in the given base.

  • Use Math.log() to get the logarithm from the value and the base and divide them.
const logBase = (n, base) => Math.log(n) / Math.log(base);
logBase(10, 10); // 1 logBase(100, 10); // 2

javascript snippet similar to logBase For You in December 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️