ReactOS 0.4.17-dev-1321-g5c122a9
logb.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS CRT
3 * LICENSE: MIT (https://spdx.org/licenses/MIT)
4 * PURPOSE: Implementation of logb.
5 * COPYRIGHT: Imported from musl libc
6 * https://git.musl-libc.org/cgit/musl/tree/src/math/logb.c
7 * blob: 7f8bdfae19f8ca0a85b611d38a73695ccf588e43
8 * See https://git.musl-libc.org/cgit/musl/tree/COPYRIGHT
9 */
10
11#include "libm.h"
12
13/*
14special cases:
15 logb(+-0) = -inf, and raise divbyzero
16 logb(+-inf) = +inf
17 logb(nan) = nan
18*/
19
20double logb(double x)
21{
22 if (!isfinite(x))
23 return x * x;
24 if (x == 0)
25 return -1/(x*x);
26 return ilogb(x);
27}
#define isfinite(x)
Definition: math.h:363
_ACRTIMP int __cdecl ilogb(double)
Definition: ilogb.c:14
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
double logb(double x)
Definition: logb.c:20