1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #include <math.h>
- #include "math_private.h"
- #if defined(__UCLIBC_HAS_FENV__)
- #include <fenv.h>
- #endif
- #if !defined __NO_LONG_DOUBLE_MATH
- long double
- log2l (long double x)
- {
- # if defined(__UCLIBC_HAS_FENV__)
- if (__builtin_expect (islessequal (x, 0.0L), 0) && _LIB_VERSION != _IEEE_)
- {
- if (x == 0.0L)
- {
- feraiseexcept (FE_DIVBYZERO);
- return __kernel_standard_l (x, x, 248);
- }
- else
- {
- feraiseexcept (FE_INVALID);
- return __kernel_standard_l (x, x, 249);
- }
- }
- # endif
- return (long double) __ieee754_log2 ((double) x);
- }
- #endif
|