Exponential and natural logarithm calculation using MC56F84789

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

Exponential and natural logarithm calculation using MC56F84789

Jump to solution
1,000 Views
LuisWoll
Contributor II

Hi 

Is there a official library for this kind of calculation for this DSP?

 

Tks

0 Kudos
Reply
1 Solution
957 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to call:

float f1,f2;

void main(void)

{

f1=1.0;
f2=exp(f1);
f2=log(2.7);

...

}

Hope it can help you

BR

XiangJun Rong

View solution in original post

0 Kudos
Reply
3 Replies
963 Views
LuisWoll
Contributor II

Tks, it works! 

In addiction to that, i looked for a ln (natural based log) function but could not find anything on the math.h, is there a way to do that? Mayber calling a log that i can define the base and write it as exp(1)...

0 Kudos
Reply
958 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls try to call:

float f1,f2;

void main(void)

{

f1=1.0;
f2=exp(f1);
f2=log(2.7);

...

}

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply
980 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

I suppose it is okay to compute the exp function, it use software float library to compute the exp value.

For the CodeWarrior for MCU ver11.x tools, I use the following code, I can pass the compilation. 

#include "math.h"

float f1,f2;

void main(void)

{

....

f1=1.0;

f2=exp(f1);

...

}

Pls have a try

BR

XiangJun Rong

0 Kudos
Reply