aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/strconv/atof.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/strconv/atof.go')
-rw-r--r--libgo/go/strconv/atof.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/go/strconv/atof.go b/libgo/go/strconv/atof.go
index cd3031b..d99117b 100644
--- a/libgo/go/strconv/atof.go
+++ b/libgo/go/strconv/atof.go
@@ -13,6 +13,7 @@ package strconv
// 3) Multiply by 2^precision and round to get mantissa.
import "math"
+import "runtime"
var optimize = true // can change for testing
@@ -300,6 +301,11 @@ func (d *decimal) atof64() (f float64, ok bool) {
if d.nd > 15 {
return
}
+ // gccgo gets this wrong on 32-bit i386 when not using -msse.
+ // See TestRoundTrip in atof_test.go for a test case.
+ if runtime.GOARCH == "386" {
+ return
+ }
switch {
case d.dp == d.nd: // int
f := d.atof64int()