add fmod, fmodf, frexp, frexpf functions

pull/1/head
HTG-YT 2021-08-07 16:05:05 +08:00
parent ef0620ba88
commit 91c3738e6c
5 changed files with 65 additions and 1 deletions

View File

@ -105,4 +105,12 @@ pub mod fmaxf;
#[path = "math/fmin.rs"]
pub mod fmin;
#[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)
}