Source file
test/fixedbugs/issue17005.go
1
2
3
4
5
6
7
8
9
10 package foo
11
12 type Flag int
13
14 const (
15 Identity Flag = iota - 2
16 Rescaling
17 )
18
19 type DrotmParams struct {
20 Flag
21 }
22
23 func Drotmg(d1, d2, x1, y1 float64) (p DrotmParams, rd1, rd2, rx1 float64) {
24
25 const (
26 gam = 4.0
27 gamsq = 16.0
28 rgamsq = 5e-8
29 )
30
31 if d1 < 0 {
32 p.Flag = Rescaling
33 return
34 }
35
36 for rd1 <= rgamsq || rd1 >= gamsq {
37 if rd1 <= rgamsq {
38 rd1 *= gam * gam
39 rx1 /= gam
40 } else {
41 rd1 /= gam * gam
42 rx1 *= gam
43 }
44 }
45 return
46 }
47
View as plain text