Re: How can I link the kernel with libgcc ?
- From: Al Viro <viro@xxxxxxxxxxxxxxxx>
- Date: Fri, 10 Mar 2006 19:18:42 +0000
On Fri, Mar 10, 2006 at 10:03:58AM -0800, Carlos Munoz wrote:
ydef[22] = (u_int32_t)(log10((double)(over & 0x0000003f)) /
log10(2));
You've got to be kidding. Let's take a good look at that expression:
log10(x)/log10(2) is what? Right, base-2 logarithm of x. Then you cast
it to unsigned, i.e. round it down. In other words, you want to know the
highest bit in (over & 0x3f). Which is to say, (fls(over & 0x3f) - 1).
Sigh...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: How can I link the kernel with libgcc ?
- From: Carlos Munoz
- Re: How can I link the kernel with libgcc ?
- References:
- How can I link the kernel with libgcc ?
- From: Carlos Munoz
- Re: How can I link the kernel with libgcc ?
- From: Lee Revell
- Re: How can I link the kernel with libgcc ?
- From: Carlos Munoz
- Re: How can I link the kernel with libgcc ?
- From: Denis Vlasenko
- Re: How can I link the kernel with libgcc ?
- From: Carlos Munoz
- How can I link the kernel with libgcc ?
- Prev by Date: Re: [PATCH 01/03] Unmapped: Implement two LRU:s
- Next by Date: Re: [PATCH 7 of 20] ipath - misc driver support code
- Previous by thread: Re: How can I link the kernel with libgcc ?
- Next by thread: Re: How can I link the kernel with libgcc ?
- Index(es):