Source
- URL: https://x.com/EricLengyel/status/867967467770920960
- Author: Eric Lengyel (@EricLengyel)
- Posted: 2017-05-26 04:55:45
Thread
1/ @EricLengyel
Needs repeating: You can always perform a signed integer range test with a single comparison. unsigned(x - lo) <= unsigned(hi - lo)
Branches: 2017-05-26-vaughncato-shouldnt-that-be-unsigned-x-unsigned-lo-unsigned, 2017-05-26-vaughncato-otherwise-ub-if-hi-int-max-and-lo-int-min, 2017-05-26-noop_dev-yeah-this-is-one-of-the-things-coworkers-hate-me, 2017-05-27-sreekotay-one-of-my-favs-and-special-cases-possible-for