Skip to main content

c/
math_sqrtfmod.rs

1// Copyright (c) 2026 Meng Zhuo
2// SPDX-License-Identifier: BSD-3-Clause
3
4// sqrt and fmod entry points backed by the libm crate.
5
6#[no_mangle]
7pub extern "C" fn sqrt(x: f64) -> f64 {
8    libm::sqrt(x)
9}
10
11#[no_mangle]
12pub extern "C" fn sqrtf(x: f32) -> f32 {
13    libm::sqrtf(x)
14}
15
16#[no_mangle]
17pub extern "C" fn fmod(x: f64, y: f64) -> f64 {
18    libm::fmod(x, y)
19}
20
21#[no_mangle]
22pub extern "C" fn fmodf(x: f32, y: f32) -> f32 {
23    libm::fmodf(x, y)
24}