Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@ x = a ^ b ^ x;
```
~(n^m)&(n^m)+1 // returns 2^x where x is the position of the common bit (0 based)
```
**Enumerate all submasks of n**
```
int s = n;
while (s > 0) {
// you can use s here
s = (s-1) & n;
}
```
## Floats

These are techniques inspired by the [fast inverse square root method.](https://en.wikipedia.org/wiki/Fast_inverse_square_root) Most of these
Expand Down