OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [go.test/] [test/] [fixedbugs/] [bug321.go] - Blame information for rev 700

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 700 jeremybenn
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug321
2
 
3
// Copyright 2011 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
// Troublesome floating point constants. Issue 1463.
8
 
9
package main
10
 
11
import "fmt"
12
 
13
func check(test string, got, want float64) bool {
14
        if got != want {
15
                fmt.Println(test, "got", got, "want", want)
16
                return false
17
        }
18
        return true
19
}
20
 
21
func main() {
22
        good := true
23
        // http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
24
        good = good && check("2.2250738585072012e-308", 2.2250738585072012e-308, 2.2250738585072014e-308)
25
        // http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
26
        good = good && check("2.2250738585072011e-308", 2.2250738585072011e-308, 2.225073858507201e-308)
27
        if !good {
28
                panic("fail")
29
        }
30
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.