Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamma function #18271

Closed
ghost opened this issue Oct 24, 2014 · 3 comments
Closed

Gamma function #18271

ghost opened this issue Oct 24, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Oct 24, 2014

It would be nice if tgamma and lgamma_r were exposed via std::num::Float. The foreign function definitions for both are present in src/libstd/num/f{32,64}.rs, but they're not exposed in the standard library.

@steveklabnik
Copy link
Member

I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.

This issue has been moved to the RFCs repo: rust-lang/rfcs#864

@blevin
Copy link

blevin commented Jun 8, 2015

If anyone needs gamma in the meantime, it turns out to be pleasingly easy to invoke the C math library one:

#[link(name = "m")]
extern {
    fn tgamma(x: f64) -> f64;
}
fn gamma(x: f64) -> f64 {
    unsafe { tgamma(x) }
}

@x-ji
Copy link

x-ji commented Apr 14, 2018

Meanwhile some external libraries also provide this functionality: https://docs.rs/statrs/0.9.0/statrs/function/gamma/fn.gamma.html

Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Jul 28, 2022
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:
- rust-lang/rfcs#864
- rust-lang#18271
TaKO8Ki added a commit to TaKO8Ki/rust that referenced this issue Jun 27, 2023
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:
- rust-lang/rfcs#864
- rust-lang#18271
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 9, 2023
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:
- rust-lang/rfcs#864
- rust-lang#18271
RalfJung pushed a commit to RalfJung/miri that referenced this issue Aug 10, 2023
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:
- rust-lang/rfcs#864
- rust-lang/rust#18271
thomcc pushed a commit to tcdi/postgrestd that referenced this issue Oct 17, 2023
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:
- rust-lang/rfcs#864
- rust-lang/rust#18271
lnicola pushed a commit to lnicola/rust-analyzer that referenced this issue Apr 7, 2024
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:
- rust-lang/rfcs#864
- rust-lang/rust#18271
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this issue Apr 27, 2024
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:
- rust-lang/rfcs#864
- rust-lang/rust#18271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants