Russ Cox | 1122836 | 2015-06-28 23:25:38 -0400 | [diff] [blame] | 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 | |
Robert Griesemer | c396c04 | 2015-09-21 15:58:19 -0700 | [diff] [blame^] | 9 | // Tests for golang.org/issue/11326. |
| 10 | |
Russ Cox | 1122836 | 2015-06-28 23:25:38 -0400 | [diff] [blame] | 11 | func main() { |
Russ Cox | 1122836 | 2015-06-28 23:25:38 -0400 | [diff] [blame] | 12 | { |
Robert Griesemer | c396c04 | 2015-09-21 15:58:19 -0700 | [diff] [blame^] | 13 | const n = 1e646456992 |
| 14 | const d = 1e646456991 |
Russ Cox | 1122836 | 2015-06-28 23:25:38 -0400 | [diff] [blame] | 15 | x := n / d |
| 16 | if x != 10.0 { |
| 17 | println("incorrect value:", x) |
| 18 | } |
| 19 | } |
| 20 | { |
Robert Griesemer | c396c04 | 2015-09-21 15:58:19 -0700 | [diff] [blame^] | 21 | const n = 1e64645699 |
| 22 | const d = 1e64645698 |
Russ Cox | 1122836 | 2015-06-28 23:25:38 -0400 | [diff] [blame] | 23 | x := n / d |
| 24 | if x != 10.0 { |
| 25 | println("incorrect value:", x) |
| 26 | } |
| 27 | } |
| 28 | { |
Robert Griesemer | c396c04 | 2015-09-21 15:58:19 -0700 | [diff] [blame^] | 29 | 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 Cox | 1122836 | 2015-06-28 23:25:38 -0400 | [diff] [blame] | 39 | x := n / d |
| 40 | if x != 10.0 { |
| 41 | println("incorrect value:", x) |
| 42 | } |
| 43 | } |
| 44 | } |