Exponential and natural logarithm calculation using MC56F84789

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Exponential and natural logarithm calculation using MC56F84789

ソリューションへジャンプ
609件の閲覧回数
LuisWoll
Contributor II

Hi 

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

 

Tks

0 件の賞賛
1 解決策
566件の閲覧回数
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 返答(返信)
572件の閲覧回数
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 件の賞賛
567件の閲覧回数
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 件の賞賛
589件の閲覧回数
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 件の賞賛