Prevent rounding errors when doing logarithms