@@ -22,49 +22,49 @@ Function: sqrt
22
22
23
23
Returns the square root
24
24
*/
25
- fn sqrt ( x : float ) -> float { libc:: sqrt ( x) }
25
+ pure fn sqrt ( x : float ) -> float { unsafe { libc:: sqrt ( x) } }
26
26
27
27
/*
28
28
Function: sin
29
29
30
30
Returns the sine of an angle
31
31
*/
32
- fn sin ( x : float ) -> float { libc:: sin ( x) }
32
+ pure fn sin ( x : float ) -> float { unsafe { libc:: sin ( x) } }
33
33
34
34
/*
35
35
Function: cos
36
36
37
37
Returns the cosine of an angle
38
38
*/
39
- fn cos ( x : float ) -> float { libc:: cos ( x) }
39
+ pure fn cos ( x : float ) -> float { unsafe { libc:: cos ( x) } }
40
40
41
41
/*
42
42
Function: tan
43
43
44
44
Returns the tangent of an angle
45
45
*/
46
- fn tan ( x : float ) -> float { libc:: tan ( x) }
46
+ pure fn tan ( x : float ) -> float { unsafe { libc:: tan ( x) } }
47
47
48
48
/*
49
49
Function: asin
50
50
51
51
Returns the arcsine of an angle
52
52
*/
53
- fn asin ( x : float ) -> float { libc:: asin ( x) }
53
+ pure fn asin ( x : float ) -> float { unsafe { libc:: asin ( x) } }
54
54
55
55
/*
56
56
Function: acos
57
57
58
58
Returns the arccosine of an angle
59
59
*/
60
- fn acos ( x : float ) -> float { libc:: acos ( x) }
60
+ pure fn acos ( x : float ) -> float { unsafe { libc:: acos ( x) } }
61
61
62
62
/*
63
63
Function: atan
64
64
65
65
Returns the arctangent of an angle
66
66
*/
67
- fn atan ( x : float ) -> float { libc:: atan ( x) }
67
+ pure fn atan ( x : float ) -> float { unsafe { libc:: atan ( x) } }
68
68
69
69
/*
70
70
Const: pi
@@ -78,14 +78,14 @@ Function: min
78
78
79
79
Returns the minimum of two values
80
80
*/
81
- fn min < copy T > ( x : T , y : T ) -> T { x < y ? x : y }
81
+ pure fn min < copy T > ( x : T , y : T ) -> T { x < y ? x : y }
82
82
83
83
/*
84
84
Function: max
85
85
86
86
Returns the maximum of two values
87
87
*/
88
- fn max < copy T > ( x : T , y : T ) -> T { x < y ? y : x }
88
+ pure fn max < copy T > ( x : T , y : T ) -> T { x < y ? y : x }
89
89
90
90
/*
91
91
Const: e
@@ -99,27 +99,27 @@ Function: ln
99
99
100
100
Returns the natural logaritm
101
101
*/
102
- fn ln ( n : float ) -> float { libc:: ln ( n) }
102
+ pure fn ln ( n : float ) -> float { unsafe { libc:: ln ( n) } }
103
103
104
104
/*
105
105
Function: log2
106
106
107
107
Returns the logarithm to base 2
108
108
*/
109
- fn log2 ( n : float ) -> float { libc:: log2 ( n) }
109
+ pure fn log2 ( n : float ) -> float { unsafe { libc:: log2 ( n) } }
110
110
111
111
/*
112
112
Function: log2
113
113
114
114
Returns the logarithm to base 10
115
115
*/
116
- fn log10 ( n : float ) -> float { libc:: log10 ( n) }
116
+ pure fn log10 ( n : float ) -> float { unsafe { libc:: log10 ( n) } }
117
117
118
118
119
119
/*
120
120
Function: log1p
121
121
122
- Returns the natural logarithm of `1+n` accurately,
122
+ Returns the natural logarithm of `1+n` accurately,
123
123
even for very small values of `n`
124
124
*/
125
- fn ln1p ( n : float ) -> float { libc:: log1p ( n) }
125
+ pure fn ln1p ( n : float ) -> float { unsafe { libc:: log1p ( n) } }
0 commit comments