reduce x into [-y .. y] modulo 2y.
static assert(0.modHalf(1) == 0); static assert(0.5.modHalf(1) == 0.5); static assert(1.modHalf(1) == 1); static assert(1.5.modHalf(1) == -0.5); static assert(2.modHalf(1) == 0); static assert(2.5.modHalf(1) == 0.5);
See Implementation
reduce x into [-y .. y] modulo 2y.