Hi everyone,
How did you solve "sqrt() not found" problem?
I working with the DSP56F805 using CodeWarrior v.5.2.
I need square root of a number to calculate fuel flow in a real time application.
What if we use this routine:
double sqroot(double x, double accuracy)
{
double newSqrt = x/2, oldSqrt = 0;
if (x < 0)
exit(1);
while (fabs(newSqrt - oldSqrt ) > accuracy)
{
oldSqrt = newSqrt;
newSqrt = 0.5 * (oldSqrt + x/oldSqrt);
}
return newSqrt;
}
Is it going to be slower than the sqrt() from math.h library?
Any suggestion on the topic would be appreciated.
Thank you.