Path: blob/master/waterbox/libc/functions/math/__fpclassifyl.c
2 views
#include "libm.h"12#if LDBL_MANT_DIG == 53 && LDBL_MAX_EXP == 10243int __fpclassifyl(long double x)4{5return __fpclassify(x);6}7#elif LDBL_MANT_DIG == 64 && LDBL_MAX_EXP == 163848int __fpclassifyl(long double x)9{10union ldshape u = {x};11int e = u.i.se & 0x7fff;12int msb = u.i.m>>63;13if (!e && !msb)14return u.i.m ? FP_SUBNORMAL : FP_ZERO;15if (!msb)16return FP_NAN;17if (e == 0x7fff)18return u.i.m << 1 ? FP_NAN : FP_INFINITE;19return FP_NORMAL;20}21#elif LDBL_MANT_DIG == 113 && LDBL_MAX_EXP == 1638422int __fpclassifyl(long double x)23{24union ldshape u = {x};25int e = u.i.se & 0x7fff;26u.i.se = 0;27if (!e)28return u.i2.lo | u.i2.hi ? FP_SUBNORMAL : FP_ZERO;29if (e == 0x7fff)30return u.i2.lo | u.i2.hi ? FP_NAN : FP_INFINITE;31return FP_NORMAL;32}33#endif343536