github.com/huandu/go@v0.0.0-20151114150818-04e615e41150/test/fixedbugs/issue11326b.go (about)

     1  // run
     2  
     3  // Copyright 2015 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  package main
     8  
     9  func main() {
    10  	/* TODO(rsc): Should work but does not. See golang.org/issue/11326.
    11  	{
    12  		const n = 1e2147483647
    13  		const d = 1e2147483646
    14  		x := n / d
    15  		if x != 10.0 {
    16  			println("incorrect value:", x)
    17  		}
    18  	}
    19  	{
    20  		const n = 1e214748364
    21  		const d = 1e214748363
    22  		x := n / d
    23  		if x != 10.0 {
    24  			println("incorrect value:", x)
    25  		}
    26  	}
    27  	*/
    28  	{
    29  		const n = 1e21474836
    30  		const d = 1e21474835
    31  		x := n / d
    32  		if x != 10.0 {
    33  			println("incorrect value:", x)
    34  		}
    35  	}
    36  	{
    37  		const n = 1e2147483
    38  		const d = 1e2147482
    39  		x := n / d
    40  		if x != 10.0 {
    41  			println("incorrect value:", x)
    42  		}
    43  	}
    44  }