add cos, cosf, cosh, coshf

pull/1/head
HTG-YT 2021-08-07 13:14:33 +08:00
parent 62090a4421
commit 3b988ea0d7
5 changed files with 65 additions and 1 deletions

View File

@ -49,4 +49,12 @@ pub mod ceilf;
#[path = "math/copysign.rs"]
pub mod copysign;
#[path = "math/copysignf.rs"]
pub mod copysignf;
pub mod copysignf;
#[path = "math/cos.rs"]
pub mod cos;
#[path = "math/cosf.rs"]
pub mod cosf;
#[path = "math/cosh.rs"]
pub mod cosh;
#[path = "math/coshf.rs"]
pub mod coshf;

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

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

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

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

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

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

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

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