Calculates the base-2 logarithm of the given value.
double log2(double value) { return math.log(value) / math.ln2; }