mirror of https://git.musl-libc.org/git/musl
Browse Source
use -1/(x*x) instead of -1/(x+0) to return -inf, -0+0 is -0 in downward rounding moders-1.0
3 changed files with 6 additions and 6 deletions
@ -1,10 +1,10 @@ |
|||
#include "libm.h" |
|||
#include <math.h> |
|||
|
|||
float logbf(float x) |
|||
{ |
|||
if (!isfinite(x)) |
|||
return x * x; |
|||
if (x == 0) |
|||
return -1/(x+0); |
|||
return -1/(x*x); |
|||
return ilogbf(x); |
|||
} |
|||
|
|||
Loading…
Reference in new issue