diff options
| author | Trevor Gross <tmgross@umich.edu> | 2024-06-27 04:13:25 -0500 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2024-08-01 15:38:51 -0400 |
| commit | fc43c01417f6351b52d8bd2dc2ba9f9fd3ede14f (patch) | |
| tree | 4f7e89f11a6d484dc2752b486602a8a1ca6b403f /library/std/src/sys/cmath.rs | |
| parent | 82b40c4d8e84ab63ff788b00c80b252887f78d86 (diff) | |
| download | rust-fc43c01417f6351b52d8bd2dc2ba9f9fd3ede14f.tar.gz rust-fc43c01417f6351b52d8bd2dc2ba9f9fd3ede14f.zip | |
Add math functions for `f16` and `f128`
This adds missing functions for math operations on the new float types. Platform support is pretty spotty at this point, since even platforms with generally good support can be missing math functions. `std/build.rs` is updated to reflect this.
Diffstat (limited to 'library/std/src/sys/cmath.rs')
| -rw-r--r-- | library/std/src/sys/cmath.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/library/std/src/sys/cmath.rs b/library/std/src/sys/cmath.rs index 99df503b82d..2997e908fa1 100644 --- a/library/std/src/sys/cmath.rs +++ b/library/std/src/sys/cmath.rs @@ -28,6 +28,21 @@ extern "C" { pub fn lgamma_r(n: f64, s: &mut i32) -> f64; pub fn lgammaf_r(n: f32, s: &mut i32) -> f32; + pub fn acosf128(n: f128) -> f128; + pub fn asinf128(n: f128) -> f128; + pub fn atanf128(n: f128) -> f128; + pub fn atan2f128(a: f128, b: f128) -> f128; + pub fn cbrtf128(n: f128) -> f128; + pub fn coshf128(n: f128) -> f128; + pub fn expm1f128(n: f128) -> f128; + pub fn hypotf128(x: f128, y: f128) -> f128; + pub fn log1pf128(n: f128) -> f128; + pub fn sinhf128(n: f128) -> f128; + pub fn tanf128(n: f128) -> f128; + pub fn tanhf128(n: f128) -> f128; + pub fn tgammaf128(n: f128) -> f128; + pub fn lgammaf128_r(n: f128, s: &mut i32) -> f128; + cfg_if::cfg_if! { if #[cfg(not(all(target_os = "windows", target_env = "msvc", target_arch = "x86")))] { pub fn acosf(n: f32) -> f32; |
