From bff9ecdaed6232549dc01da23a8d24e1c5c07c20 Mon Sep 17 00:00:00 2001 From: HTG-YT Date: Sat, 7 Aug 2021 16:05:05 +0800 Subject: [PATCH] add fmod, fmodf, frexp, frexpf functions --- src/lib.rs | 10 +++++++++- src/math/fmod.rs | 14 ++++++++++++++ src/math/fmodf.rs | 14 ++++++++++++++ src/math/frexp.rs | 14 ++++++++++++++ src/math/frexpf.rs | 14 ++++++++++++++ 5 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 src/math/fmod.rs create mode 100644 src/math/fmodf.rs create mode 100644 src/math/frexp.rs create mode 100644 src/math/frexpf.rs diff --git a/src/lib.rs b/src/lib.rs index 24e5875..f7b8e08 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -105,4 +105,12 @@ pub mod fmaxf; #[path = "math/fmin.rs"] pub mod fmin; #[path = "math/fminf.rs"] -pub mod fminf; \ No newline at end of file +pub mod fminf; +#[path = "math/fmod.rs"] +pub mod fmod; +#[path = "math/fmodf.rs"] +pub mod fmodf; +#[path = "math/frexp.rs"] +pub mod frexp; +#[path = "math/frexpf.rs"] +pub mod frexpf; \ No newline at end of file diff --git a/src/math/fmod.rs b/src/math/fmod.rs new file mode 100644 index 0000000..26706f8 --- /dev/null +++ b/src/math/fmod.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/fmod.rs + * + * The fmod function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn fmod(x: f64, y: f64) -> f64 { + libm::fmod(x, y) +} \ No newline at end of file diff --git a/src/math/fmodf.rs b/src/math/fmodf.rs new file mode 100644 index 0000000..35401da --- /dev/null +++ b/src/math/fmodf.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/fmodf.rs + * + * The fmodf function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn fmodf(x: f32, y: f32) -> f32 { + libm::fmodf(x, y) +} \ No newline at end of file diff --git a/src/math/frexp.rs b/src/math/frexp.rs new file mode 100644 index 0000000..fd21d28 --- /dev/null +++ b/src/math/frexp.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/frexp.rs + * + * The frexp function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn frexp(x: f64) -> (f64, i32) { + libm::frexp(x) +} \ No newline at end of file diff --git a/src/math/frexpf.rs b/src/math/frexpf.rs new file mode 100644 index 0000000..650aa58 --- /dev/null +++ b/src/math/frexpf.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: MPL-2.0 +/* + * File: src/math/frexpf.rs + * + * The frexpf function. + * + * Author: HTG-YT + * Copyright (c) 2021 The LibM Team of the HaruxOS Project + */ + +#[no_mangle] +pub extern "C" fn frexpf(x: f32) -> (f32, i32) { + libm::frexpf(x) +} \ No newline at end of file