-
Notifications
You must be signed in to change notification settings - Fork 4
/
_exp_test.go
96 lines (73 loc) · 1.81 KB
/
_exp_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package snd
import (
"fmt"
"math"
"testing"
)
func TestRadian(t *testing.T) {
var rad Radian
const n = 10
onethird := Radian(math.MaxUint64 / 3.)
for i := 1; i < n; i++ {
rad += onethird + onethird + onethird
fmt.Println(rad.Degrees())
fmt.Println(math.MaxUint64 - rad)
fmt.Println()
// if rad.Degrees() != 360 {
// t.Fatalf("failed on iteration %v", i)
// }
}
// var rad Radian2
// fmt.Println(RPiTwo % 3)
// x := float64(RPiTwo) / 3.0
// onethird := Radian2(x)
// fmt.Println(onethird)
// for i := 0; i < 10; i++ {
// rad += onethird
// fmt.Println(rad.Degrees())
// }
// var z Radian2
// const n = 44100
// for i := 1; i < n; i++ {
// z += RPiTwo
// if uint64(z)%uint64(RPiTwo) != 0 {
// t.Fatalf("%v: mod failed for %v", i, z)
// }
// if uint64(i) != z.Hertz() {
// t.Fatalf("%v: hertz failed for %v", i, z)
// }
// t.Log(z.Degrees(), z.Hertz(), uint64(z)%uint64(RPiTwo))
// }
// z += 1
// t.Log(z.Degrees(), z.Hertz(), uint64(z)%uint64(RPiTwo))
// x := uint64(math.MaxUint64)
// for ; x%uint64(RPiTwo) != 0; x-- {
// }
// t.Log(x % uint64(RPiTwo))
// t.Logf("0x%016X", x)
// THz GHz MHz kHz Hz
// 281,474,976,710,655
// t.Log(Radian2(MaxHertz).Hertz())
// 281,474,976,645,120
// t.Log(Radian2(MaxHertz2).Hertz())
// 4,294,967,295
// t.Log(MaxHertz2 / 0x100000000)
// t.Log(MaxHertz3 / 0x1000000000000)
// mHz μHz nHz pHz fHz
// 000000000.000,000,000,232,830,64365386963e-10
// t.Log(1. / (1. + math.MaxUint32))
// t.Log(RPiTwo)
// t.Log(2. / 65536)
// 0.000,015,258,789,0625
// t.Log(RPi.Degrees())
// t.Log(math.MaxUint64 / RPi)
// x := 2 * RPi
// t.Logf("0x%016X", x)
// 562,949,953,421,311
// a := 750 * Millihertz
// r := a.Angular()
// t.Log(r.Degrees() / 360.0 / float64(HHertz))
// r2 := Radian(a)
// t.Log(r2)
// t.Log(r2.Degrees())
}