Correct assignment

This commit is contained in:
gingerBill
2022-08-15 16:31:59 +01:00
parent 737bccbd5e
commit 208f168564

View File

@@ -623,8 +623,8 @@ divmod :: #force_inline proc "contextless" (x, y: $T) -> (div, mod: T)
floor_divmod :: #force_inline proc "contextless" (x, y: $T) -> (div, mod: T)
where intrinsics.type_is_integer(T) {
div := x / y
mod := x % y
div = x / y
mod = x % y
if (div > 0 && y < 0) || (mod < 0 && y > 0) {
div -= 1
mod += y