implement acos, acosf, acosh, acoshf

This commit is contained in:
HTG-YT 2021-08-06 23:15:59 +08:00
parent c48c792f91
commit 1ea320e6f6
6 changed files with 71 additions and 3 deletions

View file

@ -4,4 +4,7 @@ version = "0.1.0"
edition = "2018" edition = "2018"
authors = [ "The LibM Team of HaruxOS" ] authors = [ "The LibM Team of HaruxOS" ]
description = "A port of `libm` that has all the required no_mangle and extern-cs for linking." description = "A port of `libm` that has all the required no_mangle and extern-cs for linking."
license = "MPL-2.0" license = "MPL-2.0"
[dependencies]
libm = "0.2.1"

View file

@ -5,7 +5,16 @@
* The externc-libm library. * The externc-libm library.
* *
* Author: HTG-YT * Author: HTG-YT
* Copyright (c) 2021 The Bootmgr Team of the HaruxOS Project * Copyright (c) 2021 The LibM Team of the HaruxOS Project
*/ */
#![no_std] #![no_std]
#[path = "math/acos.rs"]
pub mod acos;
#[path = "math/acosf.rs"]
pub mod acosf;
#[path = "math/acosh.rs"]
pub mod acosh;
#[path = "math/acoshf.rs"]
pub mod acoshf;

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

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

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

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

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

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

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

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