2 * From: @(#)s_ilogb.c 5.1 93/09/24
3 * ====================================================
4 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
6 * Developed at SunPro, a Sun Microsystems, Inc. business.
7 * Permission to use, copy, modify, and distribute this
8 * software is freely granted, provided that this notice
10 * ====================================================
14 static char rcsid
[] = "$FreeBSD: src/lib/msun/src/s_ilogbl.c,v 1.1 2004/10/11 18:13:52 stefanf Exp $";
31 if (u
.bits
.exp
== 0) {
32 if ((u
.bits
.manl
| u
.bits
.manh
) == 0)
35 if (u
.bits
.manh
== 0) {
36 m
= 1lu << (LDBL_MANL_SIZE
- 1);
37 for (b
= LDBL_MANH_SIZE
; !(u
.bits
.manl
& m
); m
>>= 1)
40 m
= 1lu << (LDBL_MANH_SIZE
- 1);
41 for (b
= 0; !(u
.bits
.manh
& m
); m
>>= 1)
44 #ifdef LDBL_IMPLICIT_NBIT
47 return (LDBL_MIN_EXP
- b
- 1);
48 } else if (u
.bits
.exp
< (LDBL_MAX_EXP
<< 1) - 1)
49 return (u
.bits
.exp
- LDBL_MAX_EXP
+ 1);
50 else if (u
.bits
.manl
!= 0 || u
.bits
.manh
!= 0)