X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Ffabsf.c;h=4efc8d686dcc49e9c4d1c1af5159f042bf5a90d5;hb=06d4075a50b84d4b80e09eb5662fc1153bd559f7;hp=516f11046ace4a27d3e093ce33253c7a6ca5f069;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd;p=musl 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; }