mirror of
https://github.com/scemama/Bit-Twiddling-Hacks-By-Sean-Eron-Anderson.git
synced 2024-11-09 07:33:43 +01:00
Update README.md
This commit is contained in:
parent
5fdaf349d6
commit
de38c8c162
@ -2461,7 +2461,9 @@ works in 4 operations and requires no subsquent verification. It simplifies
|
|||||||
to
|
to
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define haszero(v) (((v) - 0x01010101UL) & ~(v) & 0x80808080UL)```
|
#define haszero(v) (((v) - 0x01010101UL) & ~(v) & 0x80808080UL)
|
||||||
|
```
|
||||||
|
|
||||||
The subexpression (v - 0x01010101UL), evaluates to a high bit set in any
|
The subexpression (v - 0x01010101UL), evaluates to a high bit set in any
|
||||||
byte whenever the corresponding byte in v is zero or greater than 0x80.
|
byte whenever the corresponding byte in v is zero or greater than 0x80.
|
||||||
The sub-expression ~v & 0x80808080UL
|
The sub-expression ~v & 0x80808080UL
|
||||||
|
Loading…
Reference in New Issue
Block a user