Corrected use of bitwise or in place of exponent operation
This commit is contained in:
parent
ee116523d8
commit
7f8f2a41fe
@ -77,12 +77,12 @@ impl Network {
|
||||
host_bits -= network_bits;
|
||||
|
||||
//Determine Spacing
|
||||
let network_spacing = 2 ^ subnet_mask[most_sig_octet].count_ones() as u8;
|
||||
let network_spacing = u8::pow(2, subnet_mask[most_sig_octet].count_ones());
|
||||
|
||||
//Determine number of networks in the subnet
|
||||
let mut num_networks: u8 = 0;
|
||||
for i in 1..network_bits {
|
||||
num_networks += 2^i;
|
||||
num_networks += u8::pow(2, u32::from(i));
|
||||
}
|
||||
|
||||
//Generate base address
|
||||
|
Loading…
Reference in New Issue
Block a user