add exp, exp10, exp10f, exp2, exp2f, expf functions

This commit is contained in:
HTG-YT 2021-08-07 13:38:12 +08:00
parent cb2ec7a2be
commit 61dee6c58b
7 changed files with 97 additions and 1 deletions

View file

@ -66,3 +66,15 @@ pub mod erfc;
pub mod erfcf; pub mod erfcf;
#[path = "math/erff.rs"] #[path = "math/erff.rs"]
pub mod erff; pub mod erff;
#[path = "math/exp.rs"]
pub mod exp;
#[path = "math/exp2.rs"]
pub mod exp2;
#[path = "math/exp2f.rs"]
pub mod exp2f;
#[path = "math/exp10.rs"]
pub mod exp10;
#[path = "math/exp10f.rs"]
pub mod exp10f;
#[path = "math/expf.rs"]
pub mod expf;

14
src/math/exp.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/exp.rs
*
* The exp function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn exp(x: f64) -> f64 {
libm::exp(x)
}

14
src/math/exp10.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/exp10.rs
*
* The exp10 function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn exp10(x: f64) -> f64 {
libm::exp10(x)
}

14
src/math/exp10f.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/exp10f.rs
*
* The exp10f function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn exp10f(x: f32) -> f32 {
libm::exp10f(x)
}

14
src/math/exp2.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/exp2.rs
*
* The exp2 function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn exp2(x: f64) -> f64 {
libm::exp2(x)
}

14
src/math/exp2f.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/exp2f.rs
*
* The exp2f function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn exp2f(x: f32) -> f32 {
libm::exp2f(x)
}

14
src/math/expf.rs Normal file
View file

@ -0,0 +1,14 @@
// SPDX-License-Identifier: MPL-2.0
/*
* File: src/math/expf.rs
*
* The expf function.
*
* Author: HTG-YT
* Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/
#[no_mangle]
pub extern "C" fn expf(x: f32) -> f32 {
libm::expf(x)
}