Corrected use of bitwise or in place of exponent operation

This commit is contained in:
Luke Else 2023-04-24 17:45:59 +01:00
parent ee116523d8
commit 7f8f2a41fe

View File

@ -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