@@ -24,26 +24,26 @@ native mod f64 {
24
24
25
25
// Alpabetically sorted by link_name
26
26
27
- fn acos ( n : f64 ) -> f64 ;
28
- fn asin ( n : f64 ) -> f64 ;
29
- fn atan ( n : f64 ) -> f64 ;
30
- fn atan2 ( a : f64 , b : f64 ) -> f64 ;
31
- fn ceil ( n : f64 ) -> f64 ;
32
- fn cos ( n : f64 ) -> f64 ;
33
- fn cosh ( n : f64 ) -> f64 ;
34
- fn exp ( n : f64 ) -> f64 ;
35
- #[ link_name="fabs" ] fn abs ( n : f64 ) -> f64 ;
36
- fn floor ( n : f64 ) -> f64 ;
37
- #[ link_name="log" ] fn ln ( n : f64 ) -> f64 ;
38
- #[ link_name="log1p" ] fn ln1p ( n : f64 ) -> f64 ;
39
- fn log10 ( n : f64 ) -> f64 ;
40
- fn log2 ( n : f64 ) -> f64 ;
41
- fn pow ( n : f64 , e : f64 ) -> f64 ;
42
- fn sin ( n : f64 ) -> f64 ;
43
- fn sinh ( n : f64 ) -> f64 ;
44
- fn sqrt ( n : f64 ) -> f64 ;
45
- fn tan ( n : f64 ) -> f64 ;
46
- fn tanh ( n : f64 ) -> f64 ;
27
+ pure fn acos ( n : f64 ) -> f64 ;
28
+ pure fn asin ( n : f64 ) -> f64 ;
29
+ pure fn atan ( n : f64 ) -> f64 ;
30
+ pure fn atan2 ( a : f64 , b : f64 ) -> f64 ;
31
+ pure fn ceil ( n : f64 ) -> f64 ;
32
+ pure fn cos ( n : f64 ) -> f64 ;
33
+ pure fn cosh ( n : f64 ) -> f64 ;
34
+ pure fn exp ( n : f64 ) -> f64 ;
35
+ #[ link_name="fabs" ] pure fn abs ( n : f64 ) -> f64 ;
36
+ pure fn floor ( n : f64 ) -> f64 ;
37
+ #[ link_name="log" ] pure fn ln ( n : f64 ) -> f64 ;
38
+ #[ link_name="log1p" ] pure fn ln1p ( n : f64 ) -> f64 ;
39
+ pure fn log10 ( n : f64 ) -> f64 ;
40
+ pure fn log2 ( n : f64 ) -> f64 ;
41
+ pure fn pow ( n : f64 , e : f64 ) -> f64 ;
42
+ pure fn sin ( n : f64 ) -> f64 ;
43
+ pure fn sinh ( n : f64 ) -> f64 ;
44
+ pure fn sqrt ( n : f64 ) -> f64 ;
45
+ pure fn tan ( n : f64 ) -> f64 ;
46
+ pure fn tanh ( n : f64 ) -> f64 ;
47
47
}
48
48
49
49
#[ link_name = "m" ]
@@ -52,26 +52,26 @@ native mod f32 {
52
52
53
53
// Alpabetically sorted by link_name
54
54
55
- #[ link_name="acosf" ] fn acos ( n : f32 ) -> f32 ;
56
- #[ link_name="asinf" ] fn asin ( n : f32 ) -> f32 ;
57
- #[ link_name="atanf" ] fn atan ( n : f32 ) -> f32 ;
58
- #[ link_name="atan2f" ] fn atan2 ( a : f32 , b : f32 ) -> f32 ;
59
- #[ link_name="ceilf" ] fn ceil ( n : f32 ) -> f32 ;
60
- #[ link_name="cosf" ] fn cos ( n : f32 ) -> f32 ;
61
- #[ link_name="coshf" ] fn cosh ( n : f32 ) -> f32 ;
62
- #[ link_name="expf" ] fn exp ( n : f32 ) -> f32 ;
63
- #[ link_name="fabsf" ] fn abs ( n : f32 ) -> f32 ;
64
- #[ link_name="floorf" ] fn floor ( n : f32 ) -> f32 ;
65
- #[ link_name="powf" ] fn pow ( n : f32 , e : f32 ) -> f32 ;
66
- #[ link_name="sinf" ] fn sin ( n : f32 ) -> f32 ;
67
- #[ link_name="sinhf" ] fn sinh ( n : f32 ) -> f32 ;
68
- #[ link_name="sqrtf" ] fn sqrt ( n : f32 ) -> f32 ;
69
- #[ link_name="tanf" ] fn tan ( n : f32 ) -> f32 ;
70
- #[ link_name="tanhf" ] fn tanh ( n : f32 ) -> f32 ;
71
- #[ link_name="logf" ] fn ln ( n : f32 ) -> f32 ;
72
- #[ link_name="log1p" ] fn ln1p ( n : f64 ) -> f64 ;
73
- #[ link_name="log2f" ] fn log2 ( n : f32 ) -> f32 ;
74
- #[ link_name="log10f" ] fn log10 ( n : f32 ) -> f32 ;
55
+ #[ link_name="acosf" ] pure fn acos ( n : f32 ) -> f32 ;
56
+ #[ link_name="asinf" ] pure fn asin ( n : f32 ) -> f32 ;
57
+ #[ link_name="atanf" ] pure fn atan ( n : f32 ) -> f32 ;
58
+ #[ link_name="atan2f" ] pure fn atan2 ( a : f32 , b : f32 ) -> f32 ;
59
+ #[ link_name="ceilf" ] pure fn ceil ( n : f32 ) -> f32 ;
60
+ #[ link_name="cosf" ] pure fn cos ( n : f32 ) -> f32 ;
61
+ #[ link_name="coshf" ] pure fn cosh ( n : f32 ) -> f32 ;
62
+ #[ link_name="expf" ] pure fn exp ( n : f32 ) -> f32 ;
63
+ #[ link_name="fabsf" ] pure fn abs ( n : f32 ) -> f32 ;
64
+ #[ link_name="floorf" ] pure fn floor ( n : f32 ) -> f32 ;
65
+ #[ link_name="powf" ] pure fn pow ( n : f32 , e : f32 ) -> f32 ;
66
+ #[ link_name="sinf" ] pure fn sin ( n : f32 ) -> f32 ;
67
+ #[ link_name="sinhf" ] pure fn sinh ( n : f32 ) -> f32 ;
68
+ #[ link_name="sqrtf" ] pure fn sqrt ( n : f32 ) -> f32 ;
69
+ #[ link_name="tanf" ] pure fn tan ( n : f32 ) -> f32 ;
70
+ #[ link_name="tanhf" ] pure fn tanh ( n : f32 ) -> f32 ;
71
+ #[ link_name="logf" ] pure fn ln ( n : f32 ) -> f32 ;
72
+ #[ link_name="log1p" ] pure fn ln1p ( n : f64 ) -> f64 ;
73
+ #[ link_name="log2f" ] pure fn log2 ( n : f32 ) -> f32 ;
74
+ #[ link_name="log10f" ] pure fn log10 ( n : f32 ) -> f32 ;
75
75
}
76
76
77
77
@@ -189,23 +189,23 @@ Function: acos
189
189
Returns the arccosine of an angle (measured in rad)
190
190
*/
191
191
pure fn acos ( x : float ) -> float
192
- { unsafe { c_float:: acos ( x as c_float ) as float } }
192
+ { c_float:: acos ( x as c_float ) as float }
193
193
194
194
/*
195
195
Function: asin
196
196
197
197
Returns the arcsine of an angle (measured in rad)
198
198
*/
199
199
pure fn asin ( x : float ) -> float
200
- { unsafe { c_float:: asin ( x as c_float ) as float } }
200
+ { c_float:: asin ( x as c_float ) as float }
201
201
202
202
/*
203
203
Function: atan
204
204
205
205
Returns the arctangents of an angle (measured in rad)
206
206
*/
207
207
pure fn atan ( x : float ) -> float
208
- { unsafe { c_float:: atan ( x as c_float ) as float } }
208
+ { c_float:: atan ( x as c_float ) as float }
209
209
210
210
211
211
/*
@@ -214,7 +214,7 @@ Function: atan2
214
214
Returns the arctangent of an angle (measured in rad)
215
215
*/
216
216
pure fn atan2 ( y : float , x : float ) -> float
217
- { unsafe { c_float:: atan2 ( y as c_float , x as c_float ) as float } }
217
+ { c_float:: atan2 ( y as c_float , x as c_float ) as float }
218
218
219
219
/*
220
220
Function: ceil
@@ -224,15 +224,15 @@ Returns:
224
224
The smallest integral value less than or equal to `n`
225
225
*/
226
226
pure fn ceil ( n : float ) -> float
227
- { unsafe { c_float:: ceil ( n as c_float ) as float } }
227
+ { c_float:: ceil ( n as c_float ) as float }
228
228
229
229
/*
230
230
Function: cos
231
231
232
232
Returns the cosine of an angle `x` (measured in rad)
233
233
*/
234
234
pure fn cos ( x : float ) -> float
235
- { unsafe { c_float:: cos ( x as c_float ) as float } }
235
+ { c_float:: cos ( x as c_float ) as float }
236
236
237
237
/*
238
238
Function: cosh
@@ -241,7 +241,7 @@ Returns the hyperbolic cosine of `x`
241
241
242
242
*/
243
243
pure fn cosh ( x : float ) -> float
244
- { unsafe { c_float:: cosh ( x as c_float ) as float } }
244
+ { c_float:: cosh ( x as c_float ) as float }
245
245
246
246
247
247
/*
@@ -252,7 +252,7 @@ Returns:
252
252
e to the power of `n*
253
253
*/
254
254
pure fn exp ( n : float ) -> float
255
- { unsafe { c_float:: exp ( n as c_float ) as float } }
255
+ { c_float:: exp ( n as c_float ) as float }
256
256
257
257
/*
258
258
Function: abs
@@ -263,7 +263,7 @@ The absolute value of `n`
263
263
264
264
*/
265
265
pure fn abs ( n : float ) -> float
266
- { unsafe { c_float:: abs ( n as c_float ) as float } }
266
+ { c_float:: abs ( n as c_float ) as float }
267
267
268
268
/*
269
269
Function: floor
@@ -273,15 +273,15 @@ Returns:
273
273
The largest integral value less than or equal to `n`
274
274
*/
275
275
pure fn floor ( n : float ) -> float
276
- { unsafe { c_float:: floor ( n as c_float ) as float } }
276
+ { c_float:: floor ( n as c_float ) as float }
277
277
278
278
/*
279
279
Function: ln
280
280
281
281
Returns the natural logaritm of `n`
282
282
*/
283
283
pure fn ln ( n : float ) -> float
284
- { unsafe { c_float:: ln ( n as c_float ) as float } }
284
+ { c_float:: ln ( n as c_float ) as float }
285
285
286
286
/*
287
287
Function: ln1p
@@ -290,29 +290,29 @@ Returns the natural logarithm of `1+n` accurately,
290
290
even for very small values of `n`
291
291
*/
292
292
pure fn ln1p ( n : float ) -> float
293
- { unsafe { c_float:: ln1p ( n as c_float ) as float } }
293
+ { c_float:: ln1p ( n as c_float ) as float }
294
294
295
295
/*
296
296
Function: log10
297
297
298
298
Returns the logarithm to base 10 of `n`
299
299
*/
300
300
pure fn log10 ( n : float ) -> float
301
- { unsafe { c_float:: log10 ( n as c_float ) as float } }
301
+ { c_float:: log10 ( n as c_float ) as float }
302
302
303
303
/*
304
304
Function: log2
305
305
306
306
Returns the logarithm to base 2 of `n`
307
307
*/
308
308
pure fn log2 ( n : float ) -> float
309
- { unsafe { c_float:: log2 ( n as c_float ) as float } }
309
+ { c_float:: log2 ( n as c_float ) as float }
310
310
311
311
/*
312
312
Function: pow
313
313
*/
314
314
pure fn pow ( v : float , e : float ) -> float
315
- { unsafe { c_float:: pow ( v as c_float , e as c_float ) as float } }
315
+ { c_float:: pow ( v as c_float , e as c_float ) as float }
316
316
317
317
318
318
/*
@@ -321,23 +321,23 @@ Function: sin
321
321
Returns the sine of an angle `x` (measured in rad)
322
322
*/
323
323
pure fn sin ( x : float ) -> float
324
- { unsafe { c_float:: sin ( x as c_float ) as float } }
324
+ { c_float:: sin ( x as c_float ) as float }
325
325
326
326
/*
327
327
Function: sinh
328
328
329
329
Returns the hyperbolic sine of an angle `x` (measured in rad)
330
330
*/
331
331
pure fn sinh ( x : float ) -> float
332
- { unsafe { c_float:: sinh ( x as c_float ) as float } }
332
+ { c_float:: sinh ( x as c_float ) as float }
333
333
334
334
/*
335
335
Function: sqrt
336
336
337
337
Returns the square root of `x`
338
338
*/
339
339
pure fn sqrt ( x : float ) -> float
340
- { unsafe { c_float:: sqrt ( x as c_float ) as float } }
340
+ { c_float:: sqrt ( x as c_float ) as float }
341
341
342
342
/*
343
343
Function: tan
@@ -346,7 +346,7 @@ Returns the tangent of an angle `x` (measured in rad)
346
346
347
347
*/
348
348
pure fn tan ( x : float ) -> float
349
- { unsafe { c_float:: tan ( x as c_float ) as float } }
349
+ { c_float:: tan ( x as c_float ) as float }
350
350
351
351
/*
352
352
Function: tanh
@@ -355,7 +355,7 @@ Returns the hyperbolic tangent of an angle `x` (measured in rad)
355
355
356
356
*/
357
357
pure fn tanh ( x : float ) -> float
358
- { unsafe { c_float:: tanh ( x as c_float ) as float } }
358
+ { c_float:: tanh ( x as c_float ) as float }
359
359
360
360
361
361
0 commit comments