|
| 1 | +//! Partial copy of std::sys::_cmath |
| 2 | +
|
| 3 | +// These symbols are all defined by `libm`, |
| 4 | +// or by `compiler-builtins` on unsupported platforms. |
| 5 | +#[allow(dead_code)] |
| 6 | +unsafe extern "C" { |
| 7 | + pub fn acos(n: f64) -> f64; |
| 8 | + pub fn asin(n: f64) -> f64; |
| 9 | + pub fn atan(n: f64) -> f64; |
| 10 | + pub fn atan2(a: f64, b: f64) -> f64; |
| 11 | + pub fn cbrt(n: f64) -> f64; |
| 12 | + pub fn cbrtf(n: f32) -> f32; |
| 13 | + pub fn cosh(n: f64) -> f64; |
| 14 | + pub fn expm1(n: f64) -> f64; |
| 15 | + pub fn expm1f(n: f32) -> f32; |
| 16 | + pub fn fdim(a: f64, b: f64) -> f64; |
| 17 | + pub fn fdimf(a: f32, b: f32) -> f32; |
| 18 | + #[cfg_attr(target_env = "msvc", link_name = "_hypot")] |
| 19 | + pub fn hypot(x: f64, y: f64) -> f64; |
| 20 | + #[cfg_attr(target_env = "msvc", link_name = "_hypotf")] |
| 21 | + 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; |
| 32 | + pub fn erf(n: f64) -> f64; |
| 33 | + pub fn erff(n: f32) -> f32; |
| 34 | + pub fn erfc(n: f64) -> f64; |
| 35 | + pub fn erfcf(n: f32) -> f32; |
| 36 | + |
| 37 | + // pub fn acosf128(n: f128) -> f128; |
| 38 | + // pub fn asinf128(n: f128) -> f128; |
| 39 | + // pub fn atanf128(n: f128) -> f128; |
| 40 | + // pub fn atan2f128(a: f128, b: f128) -> f128; |
| 41 | + // pub fn cbrtf128(n: f128) -> f128; |
| 42 | + // pub fn coshf128(n: f128) -> f128; |
| 43 | + // pub fn expm1f128(n: f128) -> f128; |
| 44 | + // pub fn hypotf128(x: f128, y: f128) -> f128; |
| 45 | + // pub fn log1pf128(n: f128) -> f128; |
| 46 | + // pub fn sinhf128(n: f128) -> f128; |
| 47 | + // pub fn tanf128(n: f128) -> f128; |
| 48 | + // pub fn tanhf128(n: f128) -> f128; |
| 49 | + // pub fn tgammaf128(n: f128) -> f128; |
| 50 | + // pub fn lgammaf128_r(n: f128, s: &mut i32) -> f128; |
| 51 | + // pub fn erff128(n: f128) -> f128; |
| 52 | + // pub fn erfcf128(n: f128) -> f128; |
| 53 | + |
| 54 | + // cfg_if::cfg_if! { |
| 55 | + // if #[cfg(not(all(target_os = "windows", target_env = "msvc", target_arch = "x86")))] { |
| 56 | + // pub fn acosf(n: f32) -> f32; |
| 57 | + // pub fn asinf(n: f32) -> f32; |
| 58 | + // pub fn atan2f(a: f32, b: f32) -> f32; |
| 59 | + // pub fn atanf(n: f32) -> f32; |
| 60 | + // pub fn coshf(n: f32) -> f32; |
| 61 | + // pub fn sinhf(n: f32) -> f32; |
| 62 | + // pub fn tanf(n: f32) -> f32; |
| 63 | + // pub fn tanhf(n: f32) -> f32; |
| 64 | + // }} |
| 65 | +} |
0 commit comments