Avoid using log2() freebsd does not support it.