X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2F__fpclassify.c;h=f7c0e2dfac828616b43f76664c6821de1b348f8d;hb=9b132e556774c744f9052581d2d8d0fab417e97c;hp=c9dd02758e5a528fc2bd0a3fcb128cd28c902e0d;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd;p=musl diff --git a/src/math/__fpclassify.c b/src/math/__fpclassify.c index c9dd0275..f7c0e2df 100644 --- a/src/math/__fpclassify.c +++ b/src/math/__fpclassify.c @@ -1,10 +1,11 @@ -#include "libm.h" +#include +#include int __fpclassify(double x) { - union dshape u = { x }; - int e = u.bits>>52 & 0x7ff; - if (!e) return u.bits<<1 ? FP_SUBNORMAL : FP_ZERO; - if (e==0x7ff) return u.bits<<12 ? FP_NAN : FP_INFINITE; + union {double f; uint64_t i;} u = {x}; + int e = u.i>>52 & 0x7ff; + if (!e) return u.i<<1 ? FP_SUBNORMAL : FP_ZERO; + if (e==0x7ff) return u.i<<12 ? FP_NAN : FP_INFINITE; return FP_NORMAL; }