"n & (n – 1) == 0" expression might be known to many. Or not.
[It allows to identify if an integer n
is a power of 2.]
It's just I find the linked #article explaining the bits behind to be nice and clear.
[#]programming #WomenInSTEM
https://thatgirlcoder.com/2020/06/12/where-can-you-use-the-expression-n-n-1/
=> More informations about this toot | View the thread | More toots from yugaego@fosstodon.org
=> View article tag | View programming tag | View womeninstem tag This content has been proxied by September (3851b).Proxy Information
text/gemini