Using arithmoi for integer logarithm.