Hacker News new | ask | show | jobs
by slaymaker1907 1329 days ago
It could or for integer types less than 4 bytes. For integers, while I don't think Java has this built in, you could use saturating subtraction (so it goes to INT_MIN or something on underflow).