Fix logBase when value < 1

Backport of @wellle's fix to `0.9.x` found in #654.