add atan, atan2, atan2f, atanf

This commit is contained in:
HTG-YT 2021-08-06 23:35:28 +08:00
parent cb14afb28a
commit f83a7e6201
5 changed files with 65 additions and 1 deletions

View file

@ -26,3 +26,11 @@ pub mod asinf;
pub mod asinh;
#[path = "math/asinhf.rs"]
pub mod asinhf;
#[path = "math/atan.rs"]
pub mod atan;
#[path = "math/atan2.rs"]
pub mod atan2;
#[path = "math/atan2f.rs"]
pub mod atan2f;
#[path = "math/atanf.rs"]
pub mod atanf;

14
src/math/atan.rs Normal file
View file

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

14
src/math/atan2.rs Normal file
View file

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

14
src/math/atan2f.rs Normal file
View file

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

14
src/math/atanf.rs Normal file
View file

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