Re: How can I link the kernel with libgcc ?

Carlos Munoz
2006-03-10T20:00:17Z

Al Viro wrote:

>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...
>
>
Hi Al,

You are right, so easy. I will look at the data sheet and make sure the
same approach can be applied to all places calling for log10
calculations. I wonder why the data sheet calls for log10 calculations.
It threw me off... should have know better though.

Thanks,

Carlos Munoz