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

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

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

Jump to solution
594 Views
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.

Labels (1)
1 Solution
420 Views
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


View solution in original post

0 Kudos
4 Replies
420 Views
admin
Specialist II

Hey :smileyhappy:

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

thank u very much.

420 Views
Monica
Senior Contributor III

AWESOME! :smileygrin:

0 Kudos
420 Views
Monica
Senior Contributor III

Feras,

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

Regards.

0 Kudos
421 Views
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 Kudos