-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasin16.go
More file actions
59 lines (54 loc) · 1.34 KB
/
asin16.go
File metadata and controls
59 lines (54 loc) · 1.34 KB
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
package floats
import "math"
// Asin returns the arcsine, in radians, of a.
//
// Special cases are:
//
// ±0.Asin() = ±0
// x.Asin() = NaN if x < -1 or x > 1
func (a Float16) Asin() Float16 {
return NewFloat16(math.Asin(a.Float64().BuiltIn()))
}
// Acos returns the arccosine, in radians, of a.
//
// Special case is:
//
// x.Acos() = NaN if x < -1 or x > 1
func (a Float16) Acos() Float16 {
return NewFloat16(math.Acos(a.Float64().BuiltIn()))
}
// Atan returns the arctangent, in radians, of a.
//
// Special cases are:
//
// ±0.Atan() = ±0
// ±Inf.Atan() = ±Pi/2
func (a Float16) Atan() Float16 {
return NewFloat16(math.Atan(a.Float64().BuiltIn()))
}
// Atan2 returns the arc tangent of a/b, using
// the signs of the two to determine the quadrant
// of the return value.
//
// Special cases are (in order):
//
// y.Atan2(NaN) = NaN
// NaN.Atan2(x) = NaN
// +0.Atan2(x>=0) = +0
// -0.Atan2(x>=0) = -0
// +0.Atan2(x<=-0) = +Pi
// -0.Atan2(x<=-0) = -Pi
// y>0.Atan2(0) = +Pi/2
// y<0.Atan2(0) = -Pi/2
// +Inf.Atan2(+Inf) = +Pi/4
// -Inf.Atan2(+Inf) = -Pi/4
// +Inf.Atan2(-Inf) = 3Pi/4
// -Inf.Atan2(-Inf) = -3Pi/4
// y.Atan2(+Inf) = 0
// (y>0).Atan2(-Inf) = +Pi
// (y<0).Atan2(-Inf) = -Pi
// +Inf.Atan2(x) = +Pi/2
// -Inf.Atan2(x) = -Pi/2
func (a Float16) Atan2(b Float16) Float16 {
return NewFloat16(math.Atan2(a.Float64().BuiltIn(), b.Float64().BuiltIn()))
}