projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
624425a81165b219a973dee4c3d0f6cbe2c3c43c
[oweals/musl.git]
/
src
/
math
/
logb.c
1
#include "libm.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+0);
16
return ilogb(x);
17
}