From 8dba5486288e719ed290cccefcd932ed32756d7c Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 4 Sep 2013 17:36:00 +0000 Subject: math: cosmetic cleanup (use explicit union instead of fshape and dshape) --- src/math/fabs.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/math/fabs.c') diff --git a/src/math/fabs.c b/src/math/fabs.c index 6e28f1e5..e8258cfd 100644 --- a/src/math/fabs.c +++ b/src/math/fabs.c @@ -1,10 +1,9 @@ -#include "libm.h" +#include +#include double fabs(double x) { - union dshape u; - - u.value = x; - u.bits &= (uint64_t)-1 / 2; - return u.value; + union {double f; uint64_t i;} u = {x}; + u.i &= -1ULL/2; + return u.f; } -- cgit v1.2.1