From 61dee6c58b67e8ad8b985710dcfd91bec1a080a1 Mon Sep 17 00:00:00 2001 From: HTG-YT Date: Sat, 7 Aug 2021 13:38:12 +0800 Subject: [PATCH] add exp, exp10, exp10f, exp2, exp2f, expf functions --- src/lib.rs | 14 +++++++++++++- src/math/exp.rs | 14 ++++++++++++++ src/math/exp10.rs | 14 ++++++++++++++ src/math/exp10f.rs | 14 ++++++++++++++ src/math/exp2.rs | 14 ++++++++++++++ src/math/exp2f.rs | 14 ++++++++++++++ src/math/expf.rs | 14 ++++++++++++++ 7 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 src/math/exp.rs create mode 100644 src/math/exp10.rs create mode 100644 src/math/exp10f.rs create mode 100644 src/math/exp2.rs create mode 100644 src/math/exp2f.rs create mode 100644 src/math/expf.rs diff --git a/src/lib.rs b/src/lib.rs index 37dda4a..35ff003 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,4 +65,16 @@ pub mod erfc; #[path = "math/erfcf.rs"] pub mod erfcf; #[path = "math/erff.rs"] -pub mod erff; \ No newline at end of file +pub mod erff; +#[path = "math/exp.rs"] +pub mod exp; +#[path = "math/exp2.rs"] +pub mod exp2; +#[path = "math/exp2f.rs"] +pub mod exp2f; +#[path = "math/exp10.rs"] +pub mod exp10; +#[path = "math/exp10f.rs"] +pub mod exp10f; +#[path = "math/expf.rs"] +pub mod expf; \ No newline at end of file diff --git a/src/math/exp.rs b/src/math/exp.rs new file mode 100644 index 0000000..d17f998 --- /dev/null +++ b/src/math/exp.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/exp.rs + * + * The exp function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn exp(x: f64) -> f64 { + libm::exp(x) +} \ No newline at end of file diff --git a/src/math/exp10.rs b/src/math/exp10.rs new file mode 100644 index 0000000..9fa5bbc --- /dev/null +++ b/src/math/exp10.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/exp10.rs + * + * The exp10 function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn exp10(x: f64) -> f64 { + libm::exp10(x) +} \ No newline at end of file diff --git a/src/math/exp10f.rs b/src/math/exp10f.rs new file mode 100644 index 0000000..e164c3c --- /dev/null +++ b/src/math/exp10f.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/exp10f.rs + * + * The exp10f function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn exp10f(x: f32) -> f32 { + libm::exp10f(x) +} \ No newline at end of file diff --git a/src/math/exp2.rs b/src/math/exp2.rs new file mode 100644 index 0000000..568a344 --- /dev/null +++ b/src/math/exp2.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/exp2.rs + * + * The exp2 function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn exp2(x: f64) -> f64 { + libm::exp2(x) +} \ No newline at end of file diff --git a/src/math/exp2f.rs b/src/math/exp2f.rs new file mode 100644 index 0000000..c66ab7f --- /dev/null +++ b/src/math/exp2f.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/exp2f.rs + * + * The exp2f function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn exp2f(x: f32) -> f32 { + libm::exp2f(x) +} \ No newline at end of file diff --git a/src/math/expf.rs b/src/math/expf.rs new file mode 100644 index 0000000..4dc9609 --- /dev/null +++ b/src/math/expf.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/expf.rs + * + * The expf function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn expf(x: f32) -> f32 { + libm::expf(x) +} \ No newline at end of file