Skip to main content

shift_count_in_range

Function shift_count_in_range 

Source
pub const fn shift_count_in_range(count: i64) -> bool
Expand description

Whether count is a number of bits an int can be shifted by.

int holds 64 bits, so a wider shift, or a negative one, names no result. The compiler asks the same question of a count written as a literal, so that one is reported before the program runs.