|
4 | 4 | // or by `compiler-builtins` on unsupported platforms. |
5 | 5 | #[allow(dead_code)] |
6 | 6 | unsafe extern "C" { |
| 7 | + // Trigonometric functions |
7 | 8 | pub fn acos(n: f64) -> f64; |
8 | 9 | pub fn asin(n: f64) -> f64; |
9 | 10 | pub fn atan(n: f64) -> f64; |
10 | 11 | pub fn atan2(a: f64, b: f64) -> f64; |
11 | | - pub fn cbrt(n: f64) -> f64; |
12 | | - pub fn cbrtf(n: f32) -> f32; |
| 12 | + pub fn cos(n: f64) -> f64; |
| 13 | + pub fn sin(n: f64) -> f64; |
| 14 | + pub fn tan(n: f64) -> f64; |
| 15 | + |
| 16 | + // Hyperbolic functions |
| 17 | + pub fn acosh(n: f64) -> f64; |
| 18 | + pub fn asinh(n: f64) -> f64; |
| 19 | + pub fn atanh(n: f64) -> f64; |
13 | 20 | pub fn cosh(n: f64) -> f64; |
| 21 | + pub fn sinh(n: f64) -> f64; |
| 22 | + pub fn tanh(n: f64) -> f64; |
| 23 | + |
| 24 | + // Exponential and logarithmic functions |
| 25 | + pub fn exp(n: f64) -> f64; |
| 26 | + pub fn exp2(n: f64) -> f64; |
14 | 27 | pub fn expm1(n: f64) -> f64; |
15 | 28 | pub fn expm1f(n: f32) -> f32; |
16 | | - pub fn fdim(a: f64, b: f64) -> f64; |
17 | | - pub fn fdimf(a: f32, b: f32) -> f32; |
| 29 | + pub fn log(n: f64) -> f64; |
| 30 | + pub fn log10(n: f64) -> f64; |
| 31 | + pub fn log1p(n: f64) -> f64; |
| 32 | + pub fn log1pf(n: f32) -> f32; |
| 33 | + pub fn log2(n: f64) -> f64; |
| 34 | + |
| 35 | + // Power functions |
| 36 | + pub fn cbrt(n: f64) -> f64; |
| 37 | + pub fn cbrtf(n: f32) -> f32; |
18 | 38 | #[cfg_attr(target_env = "msvc", link_name = "_hypot")] |
19 | 39 | pub fn hypot(x: f64, y: f64) -> f64; |
20 | 40 | #[cfg_attr(target_env = "msvc", link_name = "_hypotf")] |
21 | 41 | pub fn hypotf(x: f32, y: f32) -> f32; |
22 | | - pub fn log1p(n: f64) -> f64; |
23 | | - pub fn log1pf(n: f32) -> f32; |
24 | | - pub fn sinh(n: f64) -> f64; |
25 | | - pub fn tan(n: f64) -> f64; |
26 | | - pub fn tanh(n: f64) -> f64; |
27 | | - pub fn tgamma(n: f64) -> f64; |
28 | | - pub fn tgammaf(n: f32) -> f32; |
29 | | - pub fn lgamma_r(n: f64, s: &mut i32) -> f64; |
30 | | - #[cfg(not(target_os = "aix"))] |
31 | | - pub fn lgammaf_r(n: f32, s: &mut i32) -> f32; |
| 42 | + pub fn pow(x: f64, y: f64) -> f64; |
| 43 | + pub fn sqrt(n: f64) -> f64; |
| 44 | + |
| 45 | + // Floating-point manipulation functions |
| 46 | + pub fn ceil(n: f64) -> f64; |
| 47 | + pub fn copysign(x: f64, y: f64) -> f64; |
| 48 | + pub fn fabs(n: f64) -> f64; |
| 49 | + pub fn fdim(a: f64, b: f64) -> f64; |
| 50 | + pub fn fdimf(a: f32, b: f32) -> f32; |
| 51 | + pub fn floor(n: f64) -> f64; |
| 52 | + pub fn fmod(x: f64, y: f64) -> f64; |
| 53 | + pub fn frexp(n: f64, exp: *mut i32) -> f64; |
| 54 | + pub fn ldexp(x: f64, n: i32) -> f64; |
| 55 | + pub fn modf(n: f64, iptr: *mut f64) -> f64; |
| 56 | + pub fn nextafter(x: f64, y: f64) -> f64; |
| 57 | + pub fn remainder(x: f64, y: f64) -> f64; |
| 58 | + pub fn trunc(n: f64) -> f64; |
| 59 | + |
| 60 | + // Special functions |
32 | 61 | pub fn erf(n: f64) -> f64; |
33 | | - pub fn erff(n: f32) -> f32; |
34 | 62 | pub fn erfc(n: f64) -> f64; |
| 63 | + pub fn erff(n: f32) -> f32; |
35 | 64 | pub fn erfcf(n: f32) -> f32; |
| 65 | + pub fn lgamma_r(n: f64, s: &mut i32) -> f64; |
| 66 | + #[cfg(not(target_os = "aix"))] |
| 67 | + pub fn lgammaf_r(n: f32, s: &mut i32) -> f32; |
| 68 | + pub fn tgamma(n: f64) -> f64; |
| 69 | + pub fn tgammaf(n: f32) -> f32; |
36 | 70 |
|
37 | 71 | // pub fn acosf128(n: f128) -> f128; |
38 | 72 | // pub fn asinf128(n: f128) -> f128; |
|
0 commit comments