diff options
| author | Robert Griesemer <gri@golang.org> | 2015-02-13 10:12:25 -0800 |
|---|---|---|
| committer | Robert Griesemer <gri@golang.org> | 2015-02-14 00:41:20 +0000 |
| commit | 7a77d8d1e9b006ae49fd456a8912a8ec03af8ec7 (patch) | |
| tree | 9e2cd867d971c44ccccf34df8243d6b01356892e /src/math/big/float_test.go | |
| parent | b5b11bdbc6be59c0449f95949d68dd4151a3a8d6 (diff) | |
| download | go-7a77d8d1e9b006ae49fd456a8912a8ec03af8ec7.tar.xz | |
math/big: use internal validation more consistently
TBR adonovan
Change-Id: If77afa6474af6cad6512f6866725e3ae5acf2e3f
Reviewed-on: https://go-review.googlesource.com/4840
Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'src/math/big/float_test.go')
| -rw-r--r-- | src/math/big/float_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/math/big/float_test.go b/src/math/big/float_test.go index dd059ba4a5..2f804fa569 100644 --- a/src/math/big/float_test.go +++ b/src/math/big/float_test.go @@ -728,6 +728,18 @@ func TestFloatNeg(t *testing.T) { } } +func TestFloatInc(t *testing.T) { + var x, one Float + // x.prec = 256 TODO(gri) This doesn't work at the moment + one.SetInt64(1) + for i := 0; i < 10; i++ { + x.Add(&x, &one) + } + if s := x.Format('g', 10); s != "10" { + t.Errorf("got %s; want 10", s) + } +} + // Selected precisions with which to run various tests. var precList = [...]uint{1, 2, 5, 8, 10, 16, 23, 24, 32, 50, 53, 64, 100, 128, 500, 511, 512, 513, 1000, 10000} |
