minus-squareredxef@feddit.orgtoProgrammer Humor@programming.dev•How should I increment an int?linkfedilinkEnglisharrow-up9·2 days agoSomething like that should do it: i = ~((~i + 1) + ~0) + 1 linkfedilink
Something like that should do it:
i = ~((~i + 1) + ~0) + 1