add log, log10, log10f, log1p, log1pf, log2, log2f, logf functions

pull/1/head
HTG-YT 2021-08-07 18:57:08 +08:00
parent 403f967f6a
commit f50a56a3e8
9 changed files with 129 additions and 1 deletions

View File

@ -145,4 +145,20 @@ pub mod lgamma_r;
#[path = "math/lgammaf.rs"]
pub mod lgammaf;
#[path = "math/lgammaf_r.rs"]
pub mod lgammaf_r;
pub mod lgammaf_r;
#[path = "math/log.rs"]
pub mod log;
#[path = "math/log1p.rs"]
pub mod log1p;
#[path = "math/log1pf.rs"]
pub mod log1pf;
#[path = "math/log2.rs"]
pub mod log2;
#[path = "math/log2f.rs"]
pub mod log2f;
#[path = "math/log10.rs"]
pub mod log10;
#[path = "math/log10f.rs"]
pub mod log10f;
#[path = "math/logf.rs"]
pub mod logf;

14
src/math/log.rs Normal file
View File

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

14
src/math/log10.rs Normal file
View File

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

14
src/math/log10f.rs Normal file
View File

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

14
src/math/log1p.rs Normal file
View File

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

14
src/math/log1pf.rs Normal file
View File

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

14
src/math/log2.rs Normal file
View File

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

14
src/math/log2f.rs Normal file
View File

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

14
src/math/logf.rs Normal file
View File

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