On Friday, 13 November 2015 at 12:06:43 UTC, Matthias Bentrup wrote: > On Friday, 13 November 2015 at 09:33:51 UTC, John Colvin wrote: >> unsigned: f(v) = v mod 2^n - 1 >> signed: f(v) = ((v + 2^(n-1)) mod (2^n - 1)) - 2^(n-1) > > I guess you meant mod 2^n in both cases... haha, yes, sorry.