blob: 4db8ef861007c2f0b9a7391f4f5d8f25fbc4ca3e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# define TGSOURCE "log1p.c"
#include "_tgmath.h"
#include <math.h>
#include <fenv.h>
TYPE TGFN(log1p)(TYPE x)
{
SIGNAL_SAFE(0);
switch (fpclassify(x)) {
case FP_ZERO: return x;
case FP_INFINITE: if (!signbit(x)) { return x; } break;
default: break;
}
if (x == -1) {
feraiseexcept(FE_DIVBYZERO);
return - INFINITY;
}
if (x < -1) {
feraiseexcept(FE_INVALID);
return NAN;
}
return x;
}
/*
STDC(199901)
XOPEN(400)
LINK(m)
*/
|