|
| 1 | +// -*- rust -*- |
| 2 | + |
| 3 | +use std; |
| 4 | +import std._uint; |
| 5 | + |
| 6 | +fn main() { |
| 7 | + check (_uint.next_power_of_two(0u) == 0u); |
| 8 | + check (_uint.next_power_of_two(1u) == 1u); |
| 9 | + check (_uint.next_power_of_two(2u) == 2u); |
| 10 | + check (_uint.next_power_of_two(3u) == 4u); |
| 11 | + check (_uint.next_power_of_two(4u) == 4u); |
| 12 | + check (_uint.next_power_of_two(5u) == 8u); |
| 13 | + check (_uint.next_power_of_two(6u) == 8u); |
| 14 | + check (_uint.next_power_of_two(7u) == 8u); |
| 15 | + check (_uint.next_power_of_two(8u) == 8u); |
| 16 | + check (_uint.next_power_of_two(9u) == 16u); |
| 17 | + check (_uint.next_power_of_two(10u) == 16u); |
| 18 | + check (_uint.next_power_of_two(11u) == 16u); |
| 19 | + check (_uint.next_power_of_two(12u) == 16u); |
| 20 | + check (_uint.next_power_of_two(13u) == 16u); |
| 21 | + check (_uint.next_power_of_two(14u) == 16u); |
| 22 | + check (_uint.next_power_of_two(15u) == 16u); |
| 23 | + check (_uint.next_power_of_two(16u) == 16u); |
| 24 | + check (_uint.next_power_of_two(17u) == 32u); |
| 25 | + check (_uint.next_power_of_two(18u) == 32u); |
| 26 | + check (_uint.next_power_of_two(19u) == 32u); |
| 27 | + check (_uint.next_power_of_two(20u) == 32u); |
| 28 | + check (_uint.next_power_of_two(21u) == 32u); |
| 29 | + check (_uint.next_power_of_two(22u) == 32u); |
| 30 | + check (_uint.next_power_of_two(23u) == 32u); |
| 31 | + check (_uint.next_power_of_two(24u) == 32u); |
| 32 | + check (_uint.next_power_of_two(25u) == 32u); |
| 33 | + check (_uint.next_power_of_two(26u) == 32u); |
| 34 | + check (_uint.next_power_of_two(27u) == 32u); |
| 35 | + check (_uint.next_power_of_two(28u) == 32u); |
| 36 | + check (_uint.next_power_of_two(29u) == 32u); |
| 37 | + check (_uint.next_power_of_two(30u) == 32u); |
| 38 | + check (_uint.next_power_of_two(31u) == 32u); |
| 39 | + check (_uint.next_power_of_two(32u) == 32u); |
| 40 | + check (_uint.next_power_of_two(33u) == 64u); |
| 41 | + check (_uint.next_power_of_two(34u) == 64u); |
| 42 | + check (_uint.next_power_of_two(35u) == 64u); |
| 43 | + check (_uint.next_power_of_two(36u) == 64u); |
| 44 | + check (_uint.next_power_of_two(37u) == 64u); |
| 45 | + check (_uint.next_power_of_two(38u) == 64u); |
| 46 | + check (_uint.next_power_of_two(39u) == 64u); |
| 47 | +} |
0 commit comments