summaryrefslogtreecommitdiff
path: root/src/math/fabs.c
blob: e8258cfdbcf1a751621a69bac02f0f0f9b22b1cf (plain) (blame)
1
2
3
4
5
6
7
8
9
#include <math.h>
#include <stdint.h>

double fabs(double x)
{
	union {double f; uint64_t i;} u = {x};
	u.i &= -1ULL/2;
	return u.f;
}