add modf, modff, nextafter, nextafterf functions

pull/1/head
HTG-YT 2021-08-07 19:26:35 +08:00
parent f50a56a3e8
commit 9480871816
5 changed files with 65 additions and 1 deletions

View File

@ -161,4 +161,12 @@ pub mod log10;
#[path = "math/log10f.rs"]
pub mod log10f;
#[path = "math/logf.rs"]
pub mod logf;
pub mod logf;
#[path = "math/modf.rs"]
pub mod modf;
#[path = "math/modff.rs"]
pub mod modff;
#[path = "math/nextafter.rs"]
pub mod nextafter;
#[path = "math/nextafterf.rs"]
pub mod nextafterf;

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

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

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

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

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

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

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

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