diff options
Diffstat (limited to 'src/math/big/float_test.go')
-rw-r--r-- | src/math/big/float_test.go | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/math/big/float_test.go b/src/math/big/float_test.go index 23abe18baa..d3b214b631 100644 --- a/src/math/big/float_test.go +++ b/src/math/big/float_test.go @@ -92,24 +92,11 @@ func TestFloatZeroValue(t *testing.T) { } func makeFloat(s string) *Float { - var x Float - - switch s { - case "0": - return &x - case "-0": - return x.Neg(&x) - case "Inf", "+Inf": - return x.SetInf(false) - case "-Inf": - return x.SetInf(true) - } - - x.SetPrec(1000) - if _, ok := x.SetString(s); !ok { - panic(fmt.Sprintf("%q is not a valid float", s)) + x, _, err := ParseFloat(s, 0, 1000, ToNearestEven) + if err != nil { + panic(err) } - return &x + return x } func TestFloatSetPrec(t *testing.T) { |