summaryrefslogtreecommitdiff
path: root/libstd/bigint.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-09-16 21:44:11 -0400
committerOri Bernstein <ori@eigenstate.org>2014-09-16 21:44:11 -0400
commitb1fe880775f7019fc3169ea31444cc59d9b232fa (patch)
tree32921635218e7980d4df3e9a8dcb3e88ffd53b66 /libstd/bigint.myr
parentce2ad1617f3577574cd47f44af4bbbfaa57c0ecf (diff)
downloadmc-b1fe880775f7019fc3169ea31444cc59d9b232fa.tar.gz
Preserve sign in division/mod
We were leaving the sign to whatever the arg came in with.
Diffstat (limited to 'libstd/bigint.myr')
-rw-r--r--libstd/bigint.myr2
1 files changed, 2 insertions, 0 deletions
diff --git a/libstd/bigint.myr b/libstd/bigint.myr
index 57b0b12..36aef42 100644
--- a/libstd/bigint.myr
+++ b/libstd/bigint.myr
@@ -419,6 +419,7 @@ const bigdiv = {a : bigint#, b : bigint# -> bigint#
bigfree(r)
slfree(a.dig)
a.dig = q.dig
+ a.sign = q.sign
free(q)
-> a
}
@@ -429,6 +430,7 @@ const bigmod = {a : bigint#, b : bigint# -> bigint#
bigfree(q)
slfree(a.dig)
a.dig = r.dig
+ a.sign = r.sign
free(r)
-> a
}