add pow, powf, remainder, remainderf, remquo, remquof, round, roundf, scalbn, scalbnf, sin, sincos, sincosf, sinf, sinh, sinhf, sqrt, sqrtf, tan, tanf, tanh, tanhf, tgamma, tgammaf, trunc, truncf, y0, y0f, y1, y1f, yn, ynf functions

This commit is contained in:
HTG-YT 2021-08-07 20:11:24 +08:00
parent 8f5262c715
commit 052849680b
33 changed files with 513 additions and 1 deletions

View file

@ -169,4 +169,68 @@ pub mod modff;
#[path = "math/nextafter.rs"] #[path = "math/nextafter.rs"]
pub mod nextafter; pub mod nextafter;
#[path = "math/nextafterf.rs"] #[path = "math/nextafterf.rs"]
pub mod nextafterf; pub mod nextafterf;
#[path = "math/pow.rs"]
pub mod pow;
#[path = "math/powf.rs"]
pub mod powf;
#[path = "math/remainder.rs"]
pub mod remainder;
#[path = "math/remainderf.rs"]
pub mod remainderf;
#[path = "math/remquo.rs"]
pub mod remquo;
#[path = "math/remquof.rs"]
pub mod remquof;
#[path = "math/round.rs"]
pub mod round;
#[path = "math/roundf.rs"]
pub mod roundf;
#[path = "math/scalbn.rs"]
pub mod scalbn;
#[path = "math/scalbnf.rs"]
pub mod scalbnf;
#[path = "math/sin.rs"]
pub mod sin;
#[path = "math/sincos.rs"]
pub mod sincos;
#[path = "math/sincosf.rs"]
pub mod sincosf;
#[path = "math/sinf.rs"]
pub mod sinf;
#[path = "math/sinh.rs"]
pub mod sinh;
#[path = "math/sinhf.rs"]
pub mod sinhf;
#[path = "math/sqrt.rs"]
pub mod sqrt;
#[path = "math/sqrtf.rs"]
pub mod sqrtf;
#[path = "math/tan.rs"]
pub mod tan;
#[path = "math/tanf.rs"]
pub mod tanf;
#[path = "math/tanh.rs"]
pub mod tanh;
#[path = "math/tanhf.rs"]
pub mod tanhf;
#[path = "math/tgamma.rs"]
pub mod tgamma;
#[path = "math/tgammaf.rs"]
pub mod tgammaf;
#[path = "math/trunc.rs"]
pub mod trunc;
#[path = "math/truncf.rs"]
pub mod truncf;
#[path = "math/y0.rs"]
pub mod y0;
#[path = "math/y0f.rs"]
pub mod y0f;
#[path = "math/y1.rs"]
pub mod y1;
#[path = "math/y1f.rs"]
pub mod y1f;
#[path = "math/yn.rs"]
pub mod yn;
#[path = "math/ynf.rs"]
pub mod ynf;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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