Source file test/fixedbugs/issue12621.go

     1  // run
     2  
     3  // Copyright 2018 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  // Issues 12576 and 12621: Negative untyped floating point constants
     8  // with small magnitude round to 0, not negative zero.
     9  
    10  package main
    11  
    12  import "math"
    13  
    14  var m = -1e-10000
    15  
    16  func main() {
    17  	if math.Signbit(m) {
    18  		panic(m)
    19  	}
    20  }
    21  

View as plain text