Loading RustViz Engine...
Verify if an integer n is a power of 2 using n & (n - 1) == 0.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
pub fn is_power_of_two(n: i32) -> bool {
n > 0 && (n & (n - 1)) == 0
}