add copysign, copysignf

pull/1/head
HTG-YT 2021-08-07 13:03:31 +08:00
parent 520b00ee89
commit 62090a4421
3 changed files with 33 additions and 1 deletions

View File

@ -45,4 +45,8 @@ pub mod cbrtf;
#[path = "math/ceil.rs"]
pub mod ceil;
#[path = "math/ceilf.rs"]
pub mod ceilf;
pub mod ceilf;
#[path = "math/copysign.rs"]
pub mod copysign;
#[path = "math/copysignf.rs"]
pub mod copysignf;

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

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

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

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