shithub: mc

Download patch

ref: cf57ad51e7ae7744b8a723f6d5fe6d67ca7c509c
parent: 8a2b92eff783f9489be2d6ed28187c0e69cc26ca
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Dec 11 14:52:52 EST 2016

Looks like I forgot to implement bigmodi

--- a/lib/std/bigint.myr
+++ b/lib/std/bigint.myr
@@ -74,6 +74,7 @@
 	generic bigsubi	: (a : bigint#, b : @a::(integral,numeric) -> bigint#)
 	generic bigmuli	: (a : bigint#, b : @a::(integral,numeric) -> bigint#)
 	generic bigdivi	: (a : bigint#, b : @a::(integral,numeric) -> bigint#)
+	generic bigmodi	: (a : bigint#, b : @a::(integral,numeric) -> bigint#)
 	generic bigshli	: (a : bigint#, b : @a::(integral,numeric) -> bigint#)
 	generic bigshri	: (a : bigint#, b : @a::(integral,numeric) -> bigint#)
 	generic bigandi	: (a : bigint#, b : @a::(integral,numeric) -> bigint#)
@@ -786,6 +787,15 @@
 
 	bigdigit(&bigb, b < 0, (b : uint64), dig[:])
 	bigdiv(a, &bigb)
+	-> a
+}
+
+generic bigmodi = {a, b
+	var bigb : bigint
+	var dig : uint32[2]
+
+	bigdigit(&bigb, b < 0, (b : uint64), dig[:])
+	bigmod(a, &bigb)
 	-> a
 }