Nice trick: for unsigned a,b,c, c<maxval/2, |a-b|<=c can be written as a-b+c<=2*c.
-
-
-
Replying to @stephentyrone
@stephentyrone Yes, but an interesting special case for 'distance between two values'.1 reply 0 retweets 0 likes
@stephentyrone My use case is making @musllibc's malloc safe against this uclinux abomination: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/fs/binfmt_elf_fdpic.c?id=19d860a140beac48a1377f179e693abe86a9dac9#n390 …
0 replies
1 retweet
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.