2015-06-28 21:25:38 -06:00
|
|
|
// run
|
|
|
|
|
2020-12-18 14:54:27 -07:00
|
|
|
// Does not work with gccgo, which uses a smaller (but still permitted)
|
|
|
|
// exponent size.
|
2023-10-17 13:07:58 -06:00
|
|
|
//go:build !gccgo
|
2020-12-18 14:54:27 -07:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2015 The Go Authors. All rights reserved.
|
2015-06-28 21:25:38 -06:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2015-09-21 16:58:19 -06:00
|
|
|
// Tests for golang.org/issue/11326.
|
|
|
|
|
2015-06-28 21:25:38 -06:00
|
|
|
func main() {
|
|
|
|
{
|
2015-09-21 16:58:19 -06:00
|
|
|
const n = 1e646456992
|
|
|
|
const d = 1e646456991
|
2015-06-28 21:25:38 -06:00
|
|
|
x := n / d
|
|
|
|
if x != 10.0 {
|
|
|
|
println("incorrect value:", x)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2015-09-21 16:58:19 -06:00
|
|
|
const n = 1e64645699
|
|
|
|
const d = 1e64645698
|
2015-06-28 21:25:38 -06:00
|
|
|
x := n / d
|
|
|
|
if x != 10.0 {
|
|
|
|
println("incorrect value:", x)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2015-09-21 16:58:19 -06:00
|
|
|
const n = 1e6464569
|
|
|
|
const d = 1e6464568
|
2015-06-28 21:25:38 -06:00
|
|
|
x := n / d
|
|
|
|
if x != 10.0 {
|
|
|
|
println("incorrect value:", x)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
2015-09-21 16:58:19 -06:00
|
|
|
const n = 1e646456
|
|
|
|
const d = 1e646455
|
2015-06-28 21:25:38 -06:00
|
|
|
x := n / d
|
|
|
|
if x != 10.0 {
|
|
|
|
println("incorrect value:", x)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|