DAY #35

Swift Bitwise operators

Bitwise operators in Swift exist, and are just like bitwise operators in C, except that they will error on overflow. However, you can disable overflow errors with these special operators:

Overflow addition (&+) Overflow subtraction (&-) Overflow multiplication (&*)

You can also define your own operators such as a logical shift “»>”.

Originally published 09/20/2021 @ https://pittcsc.org/ Discord

Published here on 09/09/2022. Blog published date reflects the original date of publication.