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