bignum: deprecate by moving into exp directory
R=rsc
CC=golang-dev
https://golang.org/cl/1211047
diff --git a/src/pkg/Makefile b/src/pkg/Makefile
index 7337951..005c957 100644
--- a/src/pkg/Makefile
+++ b/src/pkg/Makefile
@@ -23,7 +23,6 @@
archive/tar\
asn1\
big\
- bignum\
bufio\
bytes\
cmath\
@@ -64,6 +63,7 @@
encoding/hex\
encoding/pem\
exec\
+ exp/bignum\
exp/datafmt\
exp/draw\
exp/eval\
diff --git a/src/pkg/bignum/Makefile b/src/pkg/exp/bignum/Makefile
similarity index 74%
rename from src/pkg/bignum/Makefile
rename to src/pkg/exp/bignum/Makefile
index c3dd595..064cf1e 100644
--- a/src/pkg/bignum/Makefile
+++ b/src/pkg/exp/bignum/Makefile
@@ -2,13 +2,13 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include ../../Make.$(GOARCH)
+include ../../../Make.$(GOARCH)
-TARG=bignum
+TARG=exp/bignum
GOFILES=\
arith.go\
bignum.go\
integer.go\
rational.go\
-include ../../Make.pkg
+include ../../../Make.pkg
diff --git a/src/pkg/bignum/arith.go b/src/pkg/exp/bignum/arith.go
similarity index 100%
rename from src/pkg/bignum/arith.go
rename to src/pkg/exp/bignum/arith.go
diff --git a/src/pkg/bignum/arith_amd64.s b/src/pkg/exp/bignum/arith_amd64.s
similarity index 100%
rename from src/pkg/bignum/arith_amd64.s
rename to src/pkg/exp/bignum/arith_amd64.s
diff --git a/src/pkg/bignum/bignum.go b/src/pkg/exp/bignum/bignum.go
similarity index 100%
rename from src/pkg/bignum/bignum.go
rename to src/pkg/exp/bignum/bignum.go
diff --git a/src/pkg/bignum/bignum_test.go b/src/pkg/exp/bignum/bignum_test.go
similarity index 97%
rename from src/pkg/bignum/bignum_test.go
rename to src/pkg/exp/bignum/bignum_test.go
index ade72dd..8db93aa 100644
--- a/src/pkg/bignum/bignum_test.go
+++ b/src/pkg/exp/bignum/bignum_test.go
@@ -331,6 +331,16 @@
for i := uint(0); i < n; i++ {
nat_eq(100+i, p.Div(MulRange(1, i)), MulRange(i+1, n))
}
+
+ // a specific test case that exposed a bug in package big
+ test_msg = "NatDivC"
+ x := natFromString("69720375229712477164533808935312303556800", 10, nil)
+ y := natFromString("3099044504245996706400", 10, nil)
+ q := natFromString("22497377864108980962", 10, nil)
+ r := natFromString("0", 10, nil)
+ qc, rc := x.DivMod(y)
+ nat_eq(0, q, qc)
+ nat_eq(1, r, rc)
}
diff --git a/src/pkg/bignum/integer.go b/src/pkg/exp/bignum/integer.go
similarity index 100%
rename from src/pkg/bignum/integer.go
rename to src/pkg/exp/bignum/integer.go
diff --git a/src/pkg/bignum/nrdiv_test.go b/src/pkg/exp/bignum/nrdiv_test.go
similarity index 100%
rename from src/pkg/bignum/nrdiv_test.go
rename to src/pkg/exp/bignum/nrdiv_test.go
diff --git a/src/pkg/bignum/rational.go b/src/pkg/exp/bignum/rational.go
similarity index 100%
rename from src/pkg/bignum/rational.go
rename to src/pkg/exp/bignum/rational.go
diff --git a/src/pkg/exp/eval/eval_test.go b/src/pkg/exp/eval/eval_test.go
index 837c4fa..1dfdfe1 100644
--- a/src/pkg/exp/eval/eval_test.go
+++ b/src/pkg/exp/eval/eval_test.go
@@ -5,7 +5,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
"flag"
"fmt"
"log"
diff --git a/src/pkg/exp/eval/expr.go b/src/pkg/exp/eval/expr.go
index 81e9ffa..ea8117d 100644
--- a/src/pkg/exp/eval/expr.go
+++ b/src/pkg/exp/eval/expr.go
@@ -5,7 +5,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
"fmt"
"go/ast"
"go/token"
diff --git a/src/pkg/exp/eval/expr1.go b/src/pkg/exp/eval/expr1.go
index 0e83053..f0a78ac 100644
--- a/src/pkg/exp/eval/expr1.go
+++ b/src/pkg/exp/eval/expr1.go
@@ -4,7 +4,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
"log"
)
diff --git a/src/pkg/exp/eval/expr_test.go b/src/pkg/exp/eval/expr_test.go
index 12914fb..7efa206 100644
--- a/src/pkg/exp/eval/expr_test.go
+++ b/src/pkg/exp/eval/expr_test.go
@@ -5,7 +5,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
"testing"
)
diff --git a/src/pkg/exp/eval/stmt.go b/src/pkg/exp/eval/stmt.go
index bb08037..bcd81f0 100644
--- a/src/pkg/exp/eval/stmt.go
+++ b/src/pkg/exp/eval/stmt.go
@@ -5,7 +5,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
"log"
"go/ast"
"go/token"
diff --git a/src/pkg/exp/eval/type.go b/src/pkg/exp/eval/type.go
index 8a0a2cf..b0fbe21 100644
--- a/src/pkg/exp/eval/type.go
+++ b/src/pkg/exp/eval/type.go
@@ -5,7 +5,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
"go/ast"
"go/token"
"log"
diff --git a/src/pkg/exp/eval/util.go b/src/pkg/exp/eval/util.go
index 6508346..ffe13e1 100644
--- a/src/pkg/exp/eval/util.go
+++ b/src/pkg/exp/eval/util.go
@@ -5,7 +5,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
)
// TODO(austin): Maybe add to bignum in more general form
diff --git a/src/pkg/exp/eval/value.go b/src/pkg/exp/eval/value.go
index 153349c..dce4bfc 100644
--- a/src/pkg/exp/eval/value.go
+++ b/src/pkg/exp/eval/value.go
@@ -5,7 +5,7 @@
package eval
import (
- "bignum"
+ "exp/bignum"
"fmt"
)
diff --git a/test/hilbert.go b/test/hilbert.go
index 9438045..07db353 100644
--- a/test/hilbert.go
+++ b/test/hilbert.go
@@ -10,7 +10,7 @@
package main
-import Big "bignum"
+import Big "exp/bignum"
import Fmt "fmt"