1
2
3
4
5
6
7
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
24 good = good && check("2.2250738585072012e-308", 2.2250738585072012e-308, 2.2250738585072014e-308)
25
26 good = good && check("2.2250738585072011e-308", 2.2250738585072011e-308, 2.225073858507201e-308)
27 if !good {
28 panic("fail")
29 }
30 }
31
View as plain text