summaryrefslogtreecommitdiff
path: root/src/math/exp2.c
blob: 16ff5940736d7f2b18afdfe3cf7f3df1ad81e56c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# define TGSOURCE "exp2.c"
#include "_tgmath.h"
#include <math.h>

TYPE TGFN(exp2)(TYPE x)
{
	switch (fpclassify(x)) {
	case FP_ZERO:		return 1.0;
	case FP_INFINITE:	return signbit(x) ? 0.0 : x;
	default:		break;
	}

	return x;
}

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