problem with Trigonometric functions ( cos, sin...)

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

problem with Trigonometric functions ( cos, sin...)

跳至解决方案
616 次查看
ferasq
Contributor I

Hey, I have HCS08JM32, I just, created a new project using floating point & #include <math.h>...

double x = cos(3.14) or any other value like cos(1), cos(1.5)... I don't get any correct answer!

for example:

double x = 0.5; // I get in the debugger x = 0.5

x = cos(3.14); // the x still equal to 0.5 in the debugger!

but when I do the same on MCF51AC256A, I get the right answers.

 

can you help me please!

thanks.

标签 (1)
1 解答
442 次查看
bigmac
Specialist III

Hello,

Did you increase the stack size from the default setting for the 'JM32.  The trigonometric functions will require copious amounts of stack space.

Regards,

Mac


在原帖中查看解决方案

0 项奖励
4 回复数
442 次查看
admin
Specialist II

Hey :smileyhappy:

that works now :smileyhappy: it was related to the stack size as suggested by bigmac!

thank u very much.

442 次查看
Monica
Senior Contributor III

AWESOME! :smileygrin:

0 项奖励
442 次查看
Monica
Senior Contributor III

Feras,

please let us know if this suggestion is helpful, keep us posted! :smileyhappy:

Regards.

0 项奖励
443 次查看
bigmac
Specialist III

Hello,

Did you increase the stack size from the default setting for the 'JM32.  The trigonometric functions will require copious amounts of stack space.

Regards,

Mac


0 项奖励