]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/ieee754/flt-32/s_logbf.c
1 /* s_logbf.c -- float version of s_logb.c.
5 * ====================================================
6 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
8 * Developed at SunPro, a Sun Microsystems, Inc. business.
9 * Permission to use, copy, modify, and distribute this
10 * software is freely granted, provided that this notice
12 * ====================================================
16 #include <math_private.h>
17 #include <libm-alias-float.h>
18 #include <fix-int-fp-convert-zero.h>
19 #include <math-use-builtins.h>
25 return __builtin_logbf (x
);
29 GET_FLOAT_WORD (ix
, x
);
30 ix
&= 0x7fffffff; /* high |x| */
32 return (float) -1.0 / fabsf (x
);
35 if (__glibc_unlikely ((rix
= ix
>> 23) == 0))
37 /* POSIX specifies that denormal number is treated as
38 though it were normalized. */
39 rix
-= __builtin_clz (ix
) - 9;
41 if (FIX_INT_FP_CONVERT_ZERO
&& rix
== 127)
43 return (float) (rix
- 127);
44 #endif /* ! USE_LOGBF_BUILTIN */
46 libm_alias_float (__logb
, logb
)