Skip to content

Commit 87369ee

Browse files
committed
start lowermost setbit explanation.
1 parent 748798c commit 87369ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

primitive-types/cheatSheet.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ What does that mean?
105105
Essentially, bitmasks are a way to manipulate values inside of a single bit. Essentially you are
106106
packaging together a series of values in the same bit. Checkout [this post](http://codeforces.com/blog/entry/18169) for more information.
107107

108-
# Lowermost setBit
108+
# Clearing Lowermost set bit
109+
The expression x & (x-1) clears the lowermost set bit. The expression x&~(x-1) extracts the lowermost
110+
bit of a. Try this out for yourself. Here's a helpful [Stackoverflow](https://softwareengineering.stackexchange.com/questions/219721/clearing-the-lowest-set-bit-of-a-number) explanation.
109111
# Signedness
110112
# Using a Cache
111113
# Commutativity and Associativity in parallel and reorder operations

0 commit comments

Comments
 (0)