Logarithm in Java

int number = 512;
int logBase = 8;
double result = Math.log(number) / Math.log(logBase);
//result is 3.0