Skip to content

Commit

Permalink
remove signnum from isinf
Browse files Browse the repository at this point in the history
  • Loading branch information
KGrewal1 committed Dec 29, 2023
1 parent 45a1a4b commit 48189b2
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions c-scape/src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -749,12 +749,24 @@ unsafe extern "C" fn isnanf(x: f32) -> i32 {

#[no_mangle]
unsafe extern "C" fn isinf(x: f64) -> i32 {
return (x.is_infinite() as i32) * x.signum() as i32;
if x == f64::INFINITY {
return 1;
} else if x == f64::NEG_INFINITY {
return -1;
} else {
return 0;
}
}

#[no_mangle]
unsafe extern "C" fn isinff(x: f32) -> i32 {
return (x.is_infinite() as i32) * x.signum() as i32;
if x == f32::INFINITY {
return 1;
} else if x == f32::NEG_INFINITY {
return -1;
} else {
return 0;
}
}

// Enable support for complex numbers only on architectures where the builtin
Expand Down

0 comments on commit 48189b2

Please sign in to comment.