add fmod, fmodf, frexp, frexpf functions

This commit is contained in:
HTG-YT 2021-08-07 16:05:05 +08:00
parent 4d62f5ddf0
commit bff9ecdaed
5 changed files with 65 additions and 1 deletions

View file

@ -106,3 +106,11 @@ pub mod fmaxf;
pub mod fmin; pub mod fmin;
#[path = "math/fminf.rs"] #[path = "math/fminf.rs"]
pub mod fminf; pub mod fminf;
#[path = "math/fmod.rs"]
pub mod fmod;
#[path = "math/fmodf.rs"]
pub mod fmodf;
#[path = "math/frexp.rs"]
pub mod frexp;
#[path = "math/frexpf.rs"]
pub mod frexpf;

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

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

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

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

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

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

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

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