Here's an example of bad things that can happen when an array of bits, each of which have a special meaning, is mishandled:
[uint32]$bitmap = 0x0002 # account disabled (2)
$bitmap = $bitmap -bor 0x0400 # cannot change password (64)
$bitmap = $bitmap -bor 0x010000 # password never expires (65536)
""
[Convert]::ToString($bitmap,2)
$bitmap = 0x0200 # Normal user (512)
[Convert]::ToString($bitmap,2)
The original value is simply replaced instead of having just the one bit manipulated:
10000010000000010 <=== Before
1000000000 <=== After