diff options
Diffstat (limited to 'src/pkg/bignum')
| -rw-r--r-- | src/pkg/bignum/Makefile | 85 | ||||
| -rwxr-xr-x | src/pkg/bignum/bignum.go | 4 | ||||
| -rw-r--r-- | src/pkg/bignum/bignum_test.go | 1 | ||||
| -rw-r--r-- | src/pkg/bignum/integer.go | 3 | ||||
| -rw-r--r-- | src/pkg/bignum/rational.go | 3 |
5 files changed, 9 insertions, 87 deletions
diff --git a/src/pkg/bignum/Makefile b/src/pkg/bignum/Makefile index 20f75bc27..bcb8752aa 100644 --- a/src/pkg/bignum/Makefile +++ b/src/pkg/bignum/Makefile @@ -2,84 +2,13 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. - -# DO NOT EDIT. Automatically generated by gobuild. -# gobuild -m arith.go bignum.go integer.go rational.go >Makefile - -D= - include $(GOROOT)/src/Make.$(GOARCH) -AR=gopack - -default: packages - -clean: - rm -rf *.[$(OS)] *.a [$(OS)].out _obj - -test: packages - gotest - -coverage: packages - gotest - 6cov -g $$(pwd) | grep -v '_test\.go:' - -%.$O: %.go - $(GC) -I_obj $*.go - -%.$O: %.c - $(CC) $*.c - -%.$O: %.s - $(AS) $*.s - -O1=\ - arith.$O\ - -O2=\ - bignum.$O\ - -O3=\ - integer.$O\ - -O4=\ - rational.$O\ - - -phases: a1 a2 a3 a4 -_obj$D/bignum.a: phases - -a1: $(O1) - $(AR) grc _obj$D/bignum.a arith.$O - rm -f $(O1) - -a2: $(O2) - $(AR) grc _obj$D/bignum.a bignum.$O - rm -f $(O2) - -a3: $(O3) - $(AR) grc _obj$D/bignum.a integer.$O - rm -f $(O3) - -a4: $(O4) - $(AR) grc _obj$D/bignum.a rational.$O - rm -f $(O4) - - -newpkg: clean - mkdir -p _obj$D - $(AR) grc _obj$D/bignum.a - -$(O1): newpkg -$(O2): a1 -$(O3): a2 -$(O4): a3 -$(O5): a4 - -nuke: clean - rm -f $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/bignum.a -packages: _obj$D/bignum.a +TARG=bignum +GOFILES=\ + arith.go\ + bignum.go\ + integer.go\ + rational.go\ -install: packages - test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D - cp _obj$D/bignum.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/bignum.a +include $(GOROOT)/src/Make.pkg diff --git a/src/pkg/bignum/bignum.go b/src/pkg/bignum/bignum.go index 2b36fbd75..7d2dde61f 100755 --- a/src/pkg/bignum/bignum.go +++ b/src/pkg/bignum/bignum.go @@ -12,7 +12,6 @@ package bignum import ( - "bignum"; "fmt"; ) @@ -308,9 +307,6 @@ func (x Natural) Sub(y Natural) Natural { } -// MulAdd128 is defined in arith.go and arith.s . -func MulAdd128(x, y, c uint64) (z1, z0 uint64) - // Returns z1 = (x*y + c) div B, z0 = (x*y + c) mod B. // func muladd11(x, y, c digit) (digit, digit) { diff --git a/src/pkg/bignum/bignum_test.go b/src/pkg/bignum/bignum_test.go index d691da232..5b4cf8fd1 100644 --- a/src/pkg/bignum/bignum_test.go +++ b/src/pkg/bignum/bignum_test.go @@ -5,7 +5,6 @@ package bignum import ( - "bignum"; "fmt"; "testing"; ) diff --git a/src/pkg/bignum/integer.go b/src/pkg/bignum/integer.go index 30e13092f..35a95bb3c 100644 --- a/src/pkg/bignum/integer.go +++ b/src/pkg/bignum/integer.go @@ -10,7 +10,6 @@ package bignum import ( - "bignum"; "fmt"; ) @@ -352,7 +351,7 @@ func (x *Integer) Shr(s uint) *Integer { // (-x) >> s == ^(x-1) >> s == ^((x-1) >> s) == -(((x-1) >> s) + 1) return MakeInt(true, x.mant.Sub(Nat(1)).Shr(s).Add(Nat(1))); } - + return MakeInt(false, x.mant.Shr(s)); } diff --git a/src/pkg/bignum/rational.go b/src/pkg/bignum/rational.go index 92b5d8883..baa9b4110 100644 --- a/src/pkg/bignum/rational.go +++ b/src/pkg/bignum/rational.go @@ -6,7 +6,6 @@ package bignum -import "bignum" import "fmt" @@ -179,7 +178,7 @@ func (x *Rational) Format(h fmt.State, c int) { // of the numerator is returned. If the mantissa contains a decimal point, // the base for the fractional part is the same as for the part before the // decimal point and the fractional part does not accept a base prefix. -// The base for the exponent is always 10. +// The base for the exponent is always 10. // func RatFromString(s string, base uint) (*Rational, uint, int) { // read numerator |
