Skip to content

Instantly share code, notes, and snippets.

@wizard04wsu
Last active August 29, 2015 13:56
Show Gist options
  • Save wizard04wsu/8829925 to your computer and use it in GitHub Desktop.
Save wizard04wsu/8829925 to your computer and use it in GitHub Desktop.
Get the logarithm of a number to a specified base.
//returns the logarithm of `num` to base `base`
if(!Math.logB){
Math.logB = function logB(num, base){
return Math.log(num)/Math.log(base);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment