11-28-2022, 02:28 AM
(11-28-2022, 02:00 AM)SMcNeill Wrote: If one needs positive values as a result from MOD, simply write a small function to get the answer in a format which you can work with:Disclaimer: in case one wants to blame the forum moderators for "it crashed and I lost my data", there should be a check for "number2" to be zero. Or just let it at the first function line, errrr...
Code: (Select All)FUNCTION ModPositive&& (number as _INTEGER64, number2 AS LONG)
temp&& = number MOD number2
IF temp&& < 0 THEN temp&& = temp&& + number
ModPositive = temp&&
END FUNCTION