add fmax, fmaxf, fmin, fminf function

pull/1/head
HTG-YT 2021-08-07 14:45:21 +08:00
parent a0c71a1266
commit ef0620ba88
5 changed files with 65 additions and 1 deletions

View File

@ -97,4 +97,12 @@ pub mod floorf;
#[path = "math/fma.rs"]
pub mod fma;
#[path = "math/fmaf.rs"]
pub mod fmaf;
pub mod fmaf;
#[path = "math/fmax.rs"]
pub mod fmax;
#[path = "math/fmaxf.rs"]
pub mod fmaxf;
#[path = "math/fmin.rs"]
pub mod fmin;
#[path = "math/fminf.rs"]
pub mod fminf;

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

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

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

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

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

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

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

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