[Click] ]use of log() funtcion in click?
Eddie Kohler
kohler at cs.ucla.edu
Wed Nov 24 14:28:29 EST 2004
Hi Philippe,
Floating point arithmetic is *not allowed* in the kernel.
The kernel does not necessarily save floating-point registers on entry,
only integer registers. That means that if you do floating-point
arithmetic in the kernel, any user programs using floating point might
go subtly wrong. Also, the Linux kernel emulates a floating-point unit
for machines that don't have one of their own; that emulation doesn't
work in kernel context. (That's probably not relevant for any machine
you deal with.)
That's why sqrt() and log() are not implemented in the kernel.
Giorgio: Your workaround is unacceptable for the same reason.
Now, if floating point is *absolutely required*, there is a workaround:
http://lkml.org/lkml/2004/5/31/5
Then something like Giorgio's code, or a math module, might work.
Eddie
On Nov 24, 2004, at 1:34 AM, Philippe De Neve wrote:
> Hi all,
>
> I have a question concerning the use of mathematical functions inside
> click
> elements. Concider next function:
>
> void GausJitter::JitterCalculate(uint32_t& _gap)
>
> {
>
> float w;
>
>
>
> w= sqrt ((-2.0 * log(w))/w);
>
>
>
> }
>
>
>
> When I compile this no errors are returned. But if I want to insmod the
> package it returns with "unresolved symbol log".
>
> Now when I remove the log function the compiling and insmod works just
> fine.
> It doesnt have any problem with the sqrt function!
>
>
>
> These headers are included:
>
>
>
> #include <click/config.h>
>
> #include <math.h>
>
> #include <click/confparse.hh>
>
>
>
> What am I missing here?
>
> Tnx for all help!
>
>
>
> Philippe.
>
>
>
>
>
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
More information about the click
mailing list