about summary refs log tree commit diff
path: root/library/std/src/sys/unix
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-09 03:14:31 +0000
committerbors <bors@rust-lang.org>2023-08-09 03:14:31 +0000
commit8838c73e866aa85b40463640ff6f5af268507812 (patch)
tree9b71827ca971493e4b0deb657f45260d54bb1d10 /library/std/src/sys/unix
parenta946c1e017a7b7202a61c89e0b2f65b348117a31 (diff)
parenta75e2284fb6c97fcc703a37e2ec1d1d1a0b4d501 (diff)
Auto merge of #99747 - ankane:float_gamma, r=workingjubilee
Add gamma function to f32 and f64

Adds the [gamma function](https://en.wikipedia.org/wiki/Gamma_function) to `f32` and `f64` (`tgamma` and `tgammaf` from C).

Refs:
- https://github.com/rust-lang/rfcs/issues/864
- https://github.com/rust-lang/rust/issues/18271
Diffstat (limited to 'library/std/src/sys/unix')
-rw-r--r--library/std/src/sys/unix/cmath.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/cmath.rs b/library/std/src/sys/unix/cmath.rs
index 2bf80d7a4cb..5346d229116 100644
--- a/library/std/src/sys/unix/cmath.rs
+++ b/library/std/src/sys/unix/cmath.rs
@@ -30,4 +30,8 @@ extern "C" {
     pub fn tanf(n: f32) -> f32;
     pub fn tanh(n: f64) -> f64;
     pub fn tanhf(n: f32) -> f32;
+    pub fn tgamma(n: f64) -> f64;
+    pub fn tgammaf(n: f32) -> f32;
+    pub fn lgamma_r(n: f64, s: &mut i32) -> f64;
+    pub fn lgammaf_r(n: f32, s: &mut i32) -> f32;
 }