Using random pausing to profile my multi-threaded application in C, I came to notice that exp()
and drand48_r()
pop up in the stack a lot.
Is there any other implementation of these functions? As for exp()
I found the answer in SO here but nobody tested this in C and I am not sure if the conversion from C++ is that straightforward.
round()
did also crop up, and I am currently using this:
int roundI(double x)
{
if (x < 0.0)
return (int)(x - 0.5);
else
return (int)(x + 0.5);
}
which I believe is efficient enough. Any comments are welcome, though.