summaryrefslogtreecommitdiff
path: root/src/math/acosh.c
blob: 7774a191b122e5748b325d949cc91fede0d73e89 (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
# define TGSOURCE "acosh.c"
#include "_tgmath.h"
#include <math.h>
#include <fenv.h>

TYPE TGFN(acosh)(TYPE x)
{
	SIGNAL_SAFE(0);
	if (x == 1.0) {
		return 0.0;
	}

	if (x < 1.0) {
		feraiseexcept(FE_INVALID);
		return NAN;
	}

	if (fpclassify(x) == FP_INFINITE && !signbit(x)) {
		return x;
	}

	return x;
}

/*
STDC(199901)
XOPEN(400)
LINK(m)
*/