]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: remove special handling for -0.0
authorRobert Griesemer <gri@golang.org>
Thu, 22 Oct 2015 21:14:41 +0000 (14:14 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 22 Oct 2015 21:19:43 +0000 (21:19 +0000)
Per the latest spec change, Go doesn't have -0 constants.

Change-Id: Ic2bcdc3bf507d121ed204f30f6744bb8764202c0
Reviewed-on: https://go-review.googlesource.com/16232
Reviewed-by: Chris Manghane <cmang@golang.org>
src/cmd/compile/internal/gc/bexport.go

index 292e3b95b2a0302f609ada067e04ae3dfab0fd88..1b2a520f0bf14a5aa695b34ba0308a98b5c29c98 100644 (file)
@@ -713,20 +713,11 @@ func (p *exporter) value(x Val) {
 }
 
 func (p *exporter) float(x *Mpflt) {
-       // extract sign, treat -0 as < 0
+       // extract sign (there is no -0)
        f := &x.Val
        sign := f.Sign()
        if sign == 0 {
-               // ±0
-               // TODO(gri) remove 'if' below if #12577 gets accepted
-               if f.Signbit() {
-                       // -0 (uncommon)
-                       p.int(-1)
-                       p.int(0)
-                       p.string("")
-                       return
-               }
-               // +0
+               // x == 0
                p.int(0)
                return
        }