Jan Ziak | cb50277 | 2014-03-19 05:48:00 +0100 | [diff] [blame] | 1 | // run |
2 | |||||
3 | // Copyright 2014 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 | // Issue 7419: odd behavior for float constants underflowing to 0 | ||||
8 | |||||
9 | package main | ||||
10 | |||||
11 | import ( | ||||
12 | "os" | ||||
13 | ) | ||||
14 | |||||
15 | var x = 1e-779137 | ||||
16 | var y = 1e-779138 | ||||
17 | |||||
18 | func main() { | ||||
19 | if x != 0 { | ||||
20 | os.Exit(1) | ||||
21 | } | ||||
22 | if y != 0 { | ||||
23 | os.Exit(2) | ||||
24 | } | ||||
25 | } |