2 ms·
"just"? That's 2 additions, 2 shifts, and 2-3 bitwise operations, while the other method is 1 addition, 1 shift, and 2 bitwise operations.
by Dylan16807 5y ago
"just"? That's 2 additions, 2 shifts, and 2-3 bitwise operations, while the other method is 1 addition, 1 shift, and 2 bitwise operations.
- rustybolt 5y agoI would think optimizing compilers can optimize this expression to the one in the article, but I tried it on godbolt and they don't.