]> Cypherpunks repositories - gostls13.git/commitdiff
bignum: deprecate by moving into exp directory
authorRobert Griesemer <gri@golang.org>
Fri, 21 May 2010 21:14:22 +0000 (14:14 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 21 May 2010 21:14:22 +0000 (14:14 -0700)
R=rsc
CC=golang-dev
https://golang.org/cl/1211047

18 files changed:
src/pkg/Makefile
src/pkg/exp/bignum/Makefile [moved from src/pkg/bignum/Makefile with 74% similarity]
src/pkg/exp/bignum/arith.go [moved from src/pkg/bignum/arith.go with 100% similarity]
src/pkg/exp/bignum/arith_amd64.s [moved from src/pkg/bignum/arith_amd64.s with 100% similarity]
src/pkg/exp/bignum/bignum.go [moved from src/pkg/bignum/bignum.go with 100% similarity]
src/pkg/exp/bignum/bignum_test.go [moved from src/pkg/bignum/bignum_test.go with 97% similarity]
src/pkg/exp/bignum/integer.go [moved from src/pkg/bignum/integer.go with 100% similarity]
src/pkg/exp/bignum/nrdiv_test.go [moved from src/pkg/bignum/nrdiv_test.go with 100% similarity]
src/pkg/exp/bignum/rational.go [moved from src/pkg/bignum/rational.go with 100% similarity]
src/pkg/exp/eval/eval_test.go
src/pkg/exp/eval/expr.go
src/pkg/exp/eval/expr1.go
src/pkg/exp/eval/expr_test.go
src/pkg/exp/eval/stmt.go
src/pkg/exp/eval/type.go
src/pkg/exp/eval/util.go
src/pkg/exp/eval/value.go
test/hilbert.go

index 7337951ae5e9123149cd3b2afbf9e728b376659c..005c957046ba67f416a444a7f178bd732084edd9 100644 (file)
@@ -23,7 +23,6 @@ DIRS=\
        archive/tar\
        asn1\
        big\
-       bignum\
        bufio\
        bytes\
        cmath\
@@ -64,6 +63,7 @@ DIRS=\
        encoding/hex\
        encoding/pem\
        exec\
+       exp/bignum\
        exp/datafmt\
        exp/draw\
        exp/eval\
similarity index 74%
rename from src/pkg/bignum/Makefile
rename to src/pkg/exp/bignum/Makefile
index c3dd595316647c3e24f50b9f80ba1657e3e97b02..064cf1eb95a0acea6b17494dc3d121c81d2b8032 100644 (file)
@@ -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
similarity index 97%
rename from src/pkg/bignum/bignum_test.go
rename to src/pkg/exp/bignum/bignum_test.go
index ade72dd1bc77a3cdc39efefcf51780c2f7602c99..8db93aa96f6d907596f0d0fa2be8fa1bb183bcd9 100644 (file)
@@ -331,6 +331,16 @@ func TestNatDiv(t *testing.T) {
        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)
 }
 
 
index 837c4fabdcf4f7677a6d9a492d9af7748a07d9ba..1dfdfe1fd6cc6af425ec1e9335a24a4100b6a142 100644 (file)
@@ -5,7 +5,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
        "flag"
        "fmt"
        "log"
index 81e9ffa9356ac2b3e3062d007c0123dcd5d9b338..ea8117d065f6f099f2ba6cd310dfdbbfe96c8603 100644 (file)
@@ -5,7 +5,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
        "fmt"
        "go/ast"
        "go/token"
index 0e83053f46a314664563f3980fcd59a7e95fa4ef..f0a78ac4d68a37911d44ee1c7ab2118eea54e1e0 100644 (file)
@@ -4,7 +4,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
        "log"
 )
 
index 12914fbd54f21d7df41878815974fd306ac3f38a..7efa2069df01cd02f7f522c4f614ea7bfc45fd31 100644 (file)
@@ -5,7 +5,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
        "testing"
 )
 
index bb080375a880f7c066e0577cf578656e2e2f7196..bcd81f04cbcac21dda5fe737a3c9975e3251271f 100644 (file)
@@ -5,7 +5,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
        "log"
        "go/ast"
        "go/token"
index 8a0a2cf2faa7c54d85a01e1e132d1fd67404ca44..b0fbe215659aa65f34ad76f99c408f0b701d7f62 100644 (file)
@@ -5,7 +5,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
        "go/ast"
        "go/token"
        "log"
index 6508346dd9eddbbe8440921d75f9ffad64adb8c8..ffe13e170289429c274d1e83bd163a6a5f16c819 100644 (file)
@@ -5,7 +5,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
 )
 
 // TODO(austin): Maybe add to bignum in more general form
index 153349c437dcb8b723dc006e8ee1c6046dceda75..dce4bfcf3de512983f636aaa5b43bab1150871e2 100644 (file)
@@ -5,7 +5,7 @@
 package eval
 
 import (
-       "bignum"
+       "exp/bignum"
        "fmt"
 )
 
index 9438045c863826bddf260dadfe23d2e54304bdea..07db353240c79d9a849ce41dcd9419b288d9adf8 100644 (file)
@@ -10,7 +10,7 @@
 
 package main
 
-import Big "bignum"
+import Big "exp/bignum"
 import Fmt "fmt"