add cos, cosf, cosh, coshf

This commit is contained in:
HTG-YT 2021-08-07 13:14:33 +08:00
parent 7d4270f800
commit cd890a1ecd
5 changed files with 65 additions and 1 deletions

View file

@ -50,3 +50,11 @@ pub mod ceilf;
pub mod copysign;
#[path = "math/copysignf.rs"]
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)
}