21
Negating compound boolean expressions (De Morgan's Laws)
(pawelgrzybek.com)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
The funny thing is that not C or Rust as languages "close to the hardware" have more specific bitwise operations - but Common Lisp has:
https://www.lispworks.com/documentation/HyperSpec/Body/f_logand.htm
https://www.lispworks.com/documentation/HyperSpec/Body/f_logcou.htm
https://www.lispworks.com/documentation/HyperSpec/Body/f_boole.htm#boole
(Though Rust has at least
popcnt()andcount_ones(), which are immensely useful e.g. when processing small sets.)