that’s a little inaccurate. it’s based on how the % operator in c++ works, which just truncates the decimal portion of the number. this works the same as flooring when A and B are both positive or both negative but not when one is positive and the other’s negative.
a more accurate equation would be A - (B * floor(A/B)) + (B/2 * (sign(A) - 1)), with the exception that when A = 0 it returns -B/2 instead of 0
if that’s not your desired behaviour, i recommend making a macro based on one of the other modulo variants Modulo - Wikipedia