add ldexp, ldexpf, lgamma, lgamma_r, lgammaf, lgammaf_r functions

This commit is contained in:
HTG-YT 2021-08-07 18:41:42 +08:00
parent fb04697e84
commit 6002ef2a8f
7 changed files with 97 additions and 1 deletions

View file

@ -133,4 +133,16 @@ pub mod j1f;
#[path = "math/jn.rs"]
pub mod jn;
#[path = "math/jnf.rs"]
pub mod jnf;
pub mod jnf;
#[path = "math/ldexp.rs"]
pub mod ldexp;
#[path = "math/ldexpf.rs"]
pub mod ldexpf;
#[path = "math/lgamma.rs"]
pub mod lgamma;
#[path = "math/lgamma_r.rs"]
pub mod lgamma_r;
#[path = "math/lgammaf.rs"]
pub mod lgammaf;
#[path = "math/lgammaf_r.rs"]
pub mod lgammaf_r;

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

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

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

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

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

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

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

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

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

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

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

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