3 ms·
This seems inefficient especially if the answer is close to a power of two? You'll spend a lot of time bouncing between exponents instead of refining the mantis
by tedunangst 6y ago
This seems inefficient especially if the answer is close to a power of two? You'll spend a lot of time bouncing between exponents instead of refining the mantissa.
- klodolph 6y agoIt's a binary search in a 64-bit search space. Powers of two are no more inefficient than other answers, on average, if you assume the answers are uniformly distributed. You could do an exponential search, which is a reasonable choice and makes logical sense, but the exponential search won't be any faster on average.