add floor, floorf, fma, fmaf functions

pull/1/head
HTG-YT 2021-08-07 14:31:09 +08:00
parent 096ef095b0
commit a0c71a1266
5 changed files with 65 additions and 1 deletions

View File

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