Blueprint modulo node doesn't handle negatives?

It’s correct behavior. The result of modulo is remainder (to next full number) of dividation, if you divide negative number to positive number and vice versa, the result will always be negative… including the remainder and same as divide it will be always directed toward 0.

-1/4 is -0.25 (not -0,75), so -1%4 will be -1

You will need to create function which in case of negative input it will Abs the result of module and using it substract 2nd number:

b-Abs(a%b)

1 Like