10 lines
142 B
Plaintext
Raw Normal View History

2022-08-07 14:14:04 -07:00
function mod_negative(val, modval) {
if val < 1 {
while val < 0 {
val += modval;
}
return val;
} else {
return val % modval;
}
}