Skip to main content

is_power_of_two

Function is_power_of_two 

Source
pub const fn is_power_of_two(n: u64) -> bool
Expand description

true if n is a power of two (1, 2, 4, …). 0 is not.

§Examples

use mathverse_core::integer::is_power_of_two;

assert!(is_power_of_two(16));
assert!(!is_power_of_two(10));