11-29-2022, 11:12 PM
(11-28-2022, 10:23 PM)Pete Wrote: Steve, yours needs some work if you pop a negatives in there as the modulo.
Code: (Select All)$CONSOLE:ONLY
PRINT "Equation Steve's Results | Pete's Results"
. . .
Function Steve_ModX (num1, num2)
Steve_ModX = ((num1 Mod num2) + num2) Mod num2
End Function
This gives correct results. What I don't understand is why the program should be wrong because of an addendum? That way I can make any program skid.
Code: (Select All)
Function Steve_ModX (num1, num2)
Steve_ModX = ((num1 Mod num2) + Abs(num2)) Mod num2
End Function
Steve_ModX = ((num1 Mod num2) + Abs(num2)) Mod num2