Logarithm in Java
Forums:
int number = 512;
int logBase = 8;
double result = Math.log(number) / Math.log(logBase);
//result is 3.0
- Log in to post comments
int number = 512;
int logBase = 8;
double result = Math.log(number) / Math.log(logBase);
//result is 3.0