rust-lang / rust-lang/rust

Tracking Issue for `erf` and `erfc` for `f16, f32, f64, f128`

Open
#136,321 7 comments 5 reactions 1 assignee View on GitHub

@GrigorenkoPV is already working on this.

Since Jan 30, 2025.

C-tracking-issue T-libs
Dominant language
Rust
Stars
119k
Forks
16.2k
PR merge metrics
PR metrics pending

Description

Feature gate: #![feature(float_erf)]

This is a tracking issue for the error function (erf) and complementary error function (erfc) in std. These functions are provided by libm and are also exposed in C's math.h (reference).

Public API
// in std, for now

impl f16 {
    pub fn erf(self) -> Self;
    pub fn erfc(self)-> Self;
}

impl f32 {
    pub fn erf(self) -> Self;
    pub fn erfc(self)-> Self;
}

impl f64 {
    pub fn erf(self) -> Self;
    pub fn erfc(self)-> Self;
}

impl f128 {
    pub fn erf(self) -> Self;
    pub fn erfc(self)-> Self;
}   
Steps / History
Unresolved Questions
  • None yet.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.