make log2 call ilog2 or frexp, fix #614