blob: 6a6ae2f4494749b8e63f2caa05b0a6b804e15fa1 [file] [log] [blame]
Russ Cox11228362015-06-28 23:25:38 -04001// 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
7package main
8
Robert Griesemerc396c042015-09-21 15:58:19 -07009// Tests for golang.org/issue/11326.
10
Russ Cox11228362015-06-28 23:25:38 -040011func main() {
Russ Cox11228362015-06-28 23:25:38 -040012 {
Robert Griesemerc396c042015-09-21 15:58:19 -070013 const n = 1e646456992
14 const d = 1e646456991
Russ Cox11228362015-06-28 23:25:38 -040015 x := n / d
16 if x != 10.0 {
17 println("incorrect value:", x)
18 }
19 }
20 {
Robert Griesemerc396c042015-09-21 15:58:19 -070021 const n = 1e64645699
22 const d = 1e64645698
Russ Cox11228362015-06-28 23:25:38 -040023 x := n / d
24 if x != 10.0 {
25 println("incorrect value:", x)
26 }
27 }
28 {
Robert Griesemerc396c042015-09-21 15:58:19 -070029 const n = 1e6464569
30 const d = 1e6464568
31 x := n / d
32 if x != 10.0 {
33 println("incorrect value:", x)
34 }
35 }
36 {
37 const n = 1e646456
38 const d = 1e646455
Russ Cox11228362015-06-28 23:25:38 -040039 x := n / d
40 if x != 10.0 {
41 println("incorrect value:", x)
42 }
43 }
44}