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

TYPE TGFN(nearbyint)(TYPE x)
{
	switch (fpclassify(x)) {
	case FP_ZERO:		return x;
	case FP_INFINITE:	return x;
	default:		break;
	}

	return x;
}

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