Why is 2 raised to 4 equal 10?
I was looking into bitwise operators in rust, and I found that println!("{:X}", 1 << 4); prints out 10, but 2^4 should equal 16. Further experimentation, using powers: let base: i32 = 2; for i in 1..=5 { print!("{:X} ", base.pow(i)); } will print out 2 4 8 10 20 when it should print out… Read More Why is 2 raised to 4 equal 10?