Mercurial > hg > CbC > CbC_gcc
diff libquadmath/math/ilogbq.c @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line diff
--- a/libquadmath/math/ilogbq.c Thu Oct 25 07:37:49 2018 +0900 +++ b/libquadmath/math/ilogbq.c Thu Feb 13 11:34:05 2020 +0900 @@ -1,4 +1,4 @@ -/* ilogbq.c -- __float128 version of s_ilogb.c. +/* s_ilogbl.c -- long double version of s_ilogb.c. * Conversion to IEEE quad long double by Jakub Jelinek, jj@ultra.linux.cz. */ @@ -17,18 +17,15 @@ static char rcsid[] = "$NetBSD: $"; #endif -/* ilogbl(__float128 x) +/* ilogbl(long double x) * return the binary exponent of non-zero x * ilogbl(0) = FP_ILOGB0 * ilogbl(NaN) = FP_ILOGBNAN (no signal is raised) * ilogbl(+-Inf) = INT_MAX (no signal is raised) */ -#include <limits.h> #include <math.h> -#include <errno.h> #include "quadmath-imp.h" - #ifndef FP_ILOGB0 # define FP_ILOGB0 INT_MIN #endif @@ -36,8 +33,7 @@ # define FP_ILOGBNAN INT_MAX #endif -int -ilogbq (__float128 x) +int ilogbq (__float128 x) { int64_t hx,lx; int ix; @@ -46,13 +42,7 @@ hx &= 0x7fffffffffffffffLL; if(hx <= 0x0001000000000000LL) { if((hx|lx)==0) - { - errno = EDOM; -#ifdef USE_FENV_H - feraiseexcept (FE_INVALID); -#endif - return FP_ILOGB0; /* ilogbl(0) = FP_ILOGB0 */ - } + { errno = EDOM; feraiseexcept (FE_INVALID); return FP_ILOGB0; } /* ilogbl(0) = FP_ILOGB0 */ else /* subnormal x */ if(hx==0) { for (ix = -16431; lx>0; lx<<=1) ix -=1; @@ -65,18 +55,7 @@ else if (FP_ILOGBNAN != INT_MAX) { /* ISO C99 requires ilogbl(+-Inf) == INT_MAX. */ if (((hx^0x7fff000000000000LL)|lx) == 0) - { - errno = EDOM; -#ifdef USE_FENV_H - feraiseexcept (FE_INVALID); -#endif - return INT_MAX; - } + { errno = EDOM; feraiseexcept (FE_INVALID); return INT_MAX; } } - - errno = EDOM; -#ifdef USE_FENV_H - feraiseexcept (FE_INVALID); -#endif - return FP_ILOGBNAN; + { errno = EDOM; feraiseexcept (FE_INVALID); return FP_ILOGBNAN; } }