This is based on the Java modulus operator, which is really a remainder operator.
As you said, the solution is to check if the answer is negative, and if it is, then you need to add the divisor to the result.
You can abstract this to a sub microflow and use that when calculating modulus so you have a single piece of shared code that behaves as you expect throughout your application.
I hope this helps.
Hi AYBERK AKBALIK,
you can use this logic,
$Dividened - floor($Dividened div $Divisor)* $Divisor
(-2)- floor(-2 div 10) * 10