Implement log2 using integer-gmp