add fmax, fmaxf, fmin, fminf function

This commit is contained in:
HTG-YT 2021-08-07 14:45:21 +08:00
parent 8ba12611f3
commit 4d62f5ddf0
5 changed files with 65 additions and 1 deletions

View file

@ -98,3 +98,11 @@ pub mod floorf;
pub mod fma; pub mod fma;
#[path = "math/fmaf.rs"] #[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)
}