repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
update contributor name in authorship notices
[musl.git]
/
src
/
math
/
logb.c
blob
7f8bdfae19f8ca0a85b611d38a73695ccf588e43
1
#include <math.h>
2
3
/*
4
special cases:
5
logb(+-0) = -inf, and raise divbyzero
6
logb(+-inf) = +inf
7
logb(nan) = nan
8
*/
9
10
double
logb
(
double
x
)
11
{
12
if
(!
isfinite
(
x
))
13
return
x
*
x
;
14
if
(
x
==
0
)
15
return
-
1
/(
x
*
x
);
16
return
ilogb
(
x
);
17
}