3 ms·
How do you increment without using "+"?
by ColinWright 14y ago
How do you increment without using "+"?
- sunir 14y agoIncrement operator ++
- ciupicri 14y agoThen as one of the comments says why not use the /= operator directly?
- femto 14y agoInvert all the least significant bits, up to and including the least significant zero.
- Tloewald 14y agoNice suggestion if we disallow ++ and still simpler than most of the other proposed solutions.
- podperson 14y ago++ Or += which is needed for the bitshift solution.