Commit 379b5a39 authored by Robert Griesemer's avatar Robert Griesemer

- steps towards implementation of div and mod

- string conversion in different bases
- tracked down a 6g bug, use work-around for now

R=r
OCL=17981
CL=17981
parent b5c739bd
This diff is collapsed.
......@@ -14,9 +14,9 @@ const (
var (
a = Bignum.NatFromString(sa);
b = Bignum.NatFromString(sb);
c = Bignum.NatFromString(sc);
a = Bignum.NatFromString(sa, 10);
b = Bignum.NatFromString(sb, 10);
c = Bignum.NatFromString(sc, 10);
)
......@@ -28,12 +28,12 @@ func TEST(msg string, b bool) {
func TestConv() {
TEST("TC1", a.Cmp(Bignum.NatFromWord(991)) == 0);
TEST("TC1", a.Cmp(Bignum.NewNat(991)) == 0);
TEST("TC2", b.Cmp(Bignum.Fact(20)) == 0);
TEST("TC3", c.Cmp(Bignum.Fact(100)) == 0);
TEST("TC4", a.String() == sa);
TEST("TC5", b.String() == sb);
TEST("TC6", c.String() == sc);
TEST("TC4", a.String(10) == sa);
TEST("TC5", b.String(10) == sb);
TEST("TC6", c.String(10) == sc);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment