56F8323: Problems using math.h library -> sqrt() not found

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

56F8323: Problems using math.h library -> sqrt() not found

4,386 Views
hlsa
Contributor I
I'm using the sqrt() function of the math.h library in my project for the 56F8323 processor.
 
When I compile my project I get the error message, that the function sqrt() has no prototype.
 
Does anybody know how I can solve this problem?
 
 
I assume that I am using a library, that doesn't support floating point operations. Does anybody know which is the right one and how I can change it?
 
Thanks,
Holger
Labels (1)
Tags (1)
0 Kudos
4 Replies

715 Views
admin
Specialist II
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.

0 Kudos

715 Views
cimbom
Contributor I
hi,

how did you solve your problem?

I can't find any function for squar root


please see the attachment what I want to realize


CodeWarrior v. 8

MC56F8036



0 Kudos

715 Views
trytohelp
NXP Employee
NXP Employee
There are some restriction with the library.
See belwo extract of the Targeting manual:

This chapter explains considerations for using C with the DSP56800E processor. Note that the DSP56800E processor does not support:

• The C++ language

• Standard C trigonometric and algebraic floating-point functions (such as sine, cosine, tangent, and square root)

Processor expert provides all the math function.
Please refer to the :

\ProcessorExpert\BEANs\DSP_Func_TFR\DSP_Func_TFRMethods.html in your installation.

Hope this will help you

Pascal

0 Kudos

715 Views
hlsa
Contributor I
Thanks for your help! I got it running now.
0 Kudos