add floor, floorf, fma, fmaf functions

This commit is contained in:
HTG-YT 2021-08-07 14:31:09 +08:00
parent 276f755737
commit 8ba12611f3
5 changed files with 65 additions and 1 deletions

View file

@ -90,3 +90,11 @@ pub mod fabsf;
pub mod fdim;
#[path = "math/fdimf.rs"]
pub mod fdimf;
#[path = "math/floor.rs"]
pub mod floor;
#[path = "math/floorf.rs"]
pub mod floorf;
#[path = "math/fma.rs"]
pub mod fma;
#[path = "math/fmaf.rs"]
pub mod fmaf;

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

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

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

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

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

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

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

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