big: Correct pow bugs from the original.

This commit is contained in:
Jeroen van Rijn
2021-08-11 20:59:51 +02:00
parent d953e40fb3
commit 5f63e3952e
3 changed files with 85 additions and 33 deletions
+6 -7
View File
@@ -57,15 +57,14 @@ demo :: proc() {
a, b, c := &Int{}, &Int{}, &Int{};
defer destroy(a, b, c);
err = set(a, -1024);
err = set(b, -1024);
for base in -3..=3 {
for power in -3..=3 {
err = pow(a, base, power);
fmt.printf("err: %v | pow(%v, %v) = ", err, base, power); print("", a, 10);
}
}
print("a", a, 10);
print("b", b, 10);
fmt.println("--- mul ---");
mul(c, a, a);
print("c", c, 10);
}
main :: proc() {