Nice trick: for unsigned a,b,c, c<maxval/2, |a-b|<=c can be written as a-b+c<=2*c.
That is, for a particular definition of |a-b| that's what I want, roughly stated as "distance in the cyclic group" rather than integer |a-b|
-
-
Stated more precisely, d(a,b)<=c, where d(a,b)=min(a-b,b-a), can be written as a-b+c<=2*c.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.