Logarithm in C#

var number = 512;
var logBase = 8;
var result = Math.Log(number, logBase);
//result is 3