Returns the least power of two that's greater than or equal to n.
Examples:
Nat.nextPowerOfTwo 0 = 1Nat.nextPowerOfTwo 1 = 1Nat.nextPowerOfTwo 2 = 2Nat.nextPowerOfTwo 3 = 4Nat.nextPowerOfTwo 5 = 8
Equations
Instances For
theorem
Nat.isPowerOfTwo_mul_two_of_isPowerOfTwo
{n : Nat}
(h : n.isPowerOfTwo)
:
(n * 2).isPowerOfTwo