1// run 2 3// Does not work with gccgo, which uses a smaller (but still permitted) 4// exponent size. 5//go:build !gccgo 6 7// Copyright 2015 The Go Authors. All rights reserved. 8// Use of this source code is governed by a BSD-style 9// license that can be found in the LICENSE file. 10 11package main 12 13// Tests for golang.org/issue/11326. 14 15func main() { 16 { 17 const n = 1e646456992 18 const d = 1e646456991 19 x := n / d 20 if x != 10.0 { 21 println("incorrect value:", x) 22 } 23 } 24 { 25 const n = 1e64645699 26 const d = 1e64645698 27 x := n / d 28 if x != 10.0 { 29 println("incorrect value:", x) 30 } 31 } 32 { 33 const n = 1e6464569 34 const d = 1e6464568 35 x := n / d 36 if x != 10.0 { 37 println("incorrect value:", x) 38 } 39 } 40 { 41 const n = 1e646456 42 const d = 1e646455 43 x := n / d 44 if x != 10.0 { 45 println("incorrect value:", x) 46 } 47 } 48} 49