codeinabox@programming.dev to Programming@programming.devEnglish · 10 days agoNegating compound boolean expressions (De Morgan's Laws)pawelgrzybek.comexternal-linkmessage-square3fedilinkarrow-up121arrow-down10
arrow-up121arrow-down1external-linkNegating compound boolean expressions (De Morgan's Laws)pawelgrzybek.comcodeinabox@programming.dev to Programming@programming.devEnglish · 10 days agomessage-square3fedilink
minus-squareHaraldvonBlauzahn@feddit.orglinkfedilinkarrow-up1·edit-21 day agoThe 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() and count_ones(), which are immensely useful e.g. when processing small sets.)
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.)