add atan, atan2, atan2f, atanf

pull/1/head
HTG-YT 2021-08-06 23:35:28 +08:00
parent ee59a54d73
commit b93f6cabd2
5 changed files with 65 additions and 1 deletions

View File

@ -25,4 +25,12 @@ pub mod asinf;
#[path = "math/asinh.rs"]
pub mod asinh;
#[path = "math/asinhf.rs"]
pub mod asinhf;
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)
}