Commit f574726f authored by Carl Shapiro's avatar Carl Shapiro

runtime: check for signed zero in printfloat

Fixes #6899

R=golang-dev, r, cshapiro, iant, rsc
CC=golang-dev
https://golang.org/cl/38120043
parent 6ede9349
......@@ -236,7 +236,10 @@ runtime·printfloat(float64 v)
n = 7; // digits printed
e = 0; // exp
s = 0; // sign
if(v != 0) {
if(v == 0) {
if(1/v == runtime·neginf)
s = 1;
} else {
// sign
if(v < 0) {
v = -v;
......
// cmpout
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "math"
func main() {
println(math.Copysign(0, -1))
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment