Skip to content

Commit

Permalink
Fixed ldexpf behaviour for NaN and Inf (e.g. ldexpf(Inf, -1))
Browse files Browse the repository at this point in the history
  • Loading branch information
ZERICO2005 authored and mateoconlechuga committed Oct 2, 2024
1 parent 98d855b commit 00d7e72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libc/ldexp.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ float _ldexpf_c(float value, int power)
int exponent;
int powerplusexponent;

if ( value == 0.0 ) return 0;
if ( value == 0.0 || !isfinite(value) ) return value;

floating.value = value;
exponent = (floating.bits >> exponent_shift) & exponent_mask;
Expand Down

0 comments on commit 00d7e72

Please sign in to comment.