Skip to content

Commit

Permalink
Added lgamma_r and lgammaf_r
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Mar 5, 2023
1 parent 39ad246 commit a8c4088
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,31 @@ no_mangle! {
fn tanf(n: f32) -> f32;
}

#[cfg(any(
all(
target_family = "wasm",
target_os = "unknown",
not(target_env = "wasi")
),
target_os = "xous",
all(target_arch = "x86_64", target_os = "uefi"),
all(target_arch = "xtensa", target_os = "none"),
all(target_vendor = "fortanix", target_env = "sgx")
))]
intrinsics! {
pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 {
let r = self::libm::lgamma_r(x);
*s = r.1;
r.0
}

pub extern "C" fn lgammaf_r(x: f32, s: &mut i32) -> f32 {
let r = self::libm::lgammaf_r(x);
*s = r.1;
r.0
}
}

#[cfg(any(
target_os = "xous",
target_os = "uefi",
Expand Down

0 comments on commit a8c4088

Please sign in to comment.