Exponential and natural logarithm calculation using MC56F84789

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Exponential and natural logarithm calculation using MC56F84789

跳至解决方案
994 次查看
LuisWoll
Contributor II

Hi 

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

 

Tks

0 项奖励
回复
1 解答
951 次查看
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 项奖励
回复
3 回复数
957 次查看
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 项奖励
回复
952 次查看
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 项奖励
回复
974 次查看
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 项奖励
回复