fix: idk, might work?

This commit is contained in:
əlemi 2022-07-03 16:47:09 +02:00
parent 93c4ddb8ca
commit b7b8ab0bce
No known key found for this signature in database
GPG key ID: BBCBFE5D7244634E

View file

@ -6,7 +6,7 @@ use pyo3::{exceptions::PyValueError, prelude::*};
fn abs(v:i32, modulo:i32) -> i32 { fn abs(v:i32, modulo:i32) -> i32 {
if v < 0 { if v < 0 {
return modulo + (v % modulo); return (modulo + (v % modulo)) % modulo;
} else { } else {
return v % modulo; return v % modulo;
} }