Math
326. Power of Three
Is n a power of three? Unlike powers of two, there's no slick single-bit test — 3 isn't a bit boundary — so the honest approach is to divide the factor of 3 out completely and see what's left. If n…
Loading…
Is n a power of three? Unlike powers of two, there's no slick single-bit test — 3 isn't a bit boundary — so the honest approach is to divide the factor of 3 out completely and see what's left. If n…
Loading…