Source file
test/float_lit3.go
1
2
3
4
5
6
7
8
9 package main
10
11
12 const (
13 two24 = 1.0 * (1 << 24)
14 two53 = 1.0 * (1 << 53)
15 two64 = 1.0 * (1 << 64)
16 two128 = two64 * two64
17 two256 = two128 * two128
18 two512 = two256 * two256
19 two768 = two512 * two256
20 two1024 = two512 * two512
21
22 ulp32 = two128 / two24
23 max32 = two128 - ulp32
24
25 ulp64 = two1024 / two53
26 max64 = two1024 - ulp64
27 )
28
29 var x = []interface{}{
30 float32(max32 + ulp32/2 - 1),
31 float32(max32 + ulp32/2 - two128/two256),
32 float32(max32 + ulp32/2),
33
34 float32(-max32 - ulp32/2 + 1),
35 float32(-max32 - ulp32/2 + two128/two256),
36 float32(-max32 - ulp32/2),
37
38
39
40 float64(max64 + ulp64/2 - two1024/two256),
41 float64(max64 + ulp64/2 - 1),
42 float64(max64 + ulp64/2),
43
44 float64(-max64 - ulp64/2 + two1024/two256),
45 float64(-max64 - ulp64/2 + 1),
46 float64(-max64 - ulp64/2),
47 }
48
View as plain text