add hypot, hypotf, ilogb, ilogbf functions

pull/1/head
HTG-YT 2021-08-07 16:09:03 +08:00
parent 91c3738e6c
commit de0bc1436b
5 changed files with 65 additions and 1 deletions

View File

@ -113,4 +113,12 @@ pub mod fmodf;
#[path = "math/frexp.rs"]
pub mod frexp;
#[path = "math/frexpf.rs"]
pub mod frexpf;
pub mod frexpf;
#[path = "math/hypot.rs"]
pub mod hypot;
#[path = "math/hypotf.rs"]
pub mod hypotf;
#[path = "math/ilogb.rs"]
pub mod ilogb;
#[path = "math/ilogbf.rs"]
pub mod ilogbf;

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

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

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

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

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

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

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

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