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/fabsf.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/math/fabsf.c') diff --git a/src/math/fabsf.c b/src/math/fabsf.c index 516f1104..4efc8d68 100644 --- a/src/math/fabsf.c +++ b/src/math/fabsf.c @@ -1,10 +1,9 @@ -#include "libm.h" +#include +#include float fabsf(float x) { - union fshape u; - - u.value = x; - u.bits &= (uint32_t)-1 / 2; - return u.value; + union {float f; uint32_t i;} u = {x}; + u.i &= 0x7fffffff; + return u.f; } -- cgit v1.2.1