2009-09-03 10:18 PM
Math routine with Cosmic free 16k and STVD 4.1.2
2011-05-17 06:04 AM
Hi,
I need the math function such atan() and acos(), but they seem not return a resonable value, my code double v; v = atan(0.2); v = acos(0.3); I observed the ''v'' in debug mode, but not a correct value of atan(0.2) or acos(0.3), what should I do to make these function work? Jason2011-05-17 06:04 AM
answer my question...
in the ''Project Settings'' -> Linker -> User Defined options, add ''-lm'' will solve this problem. but I find another problem, if I declare the v as local variable (in main.c), the returned value never correct, if it is declared as global variable, the returned value is correct, why?2011-05-17 06:04 AM
2011-05-17 06:04 AM
Hi Luca,
Thanks for your advisement, I will check for the optimiaztion. BTW, the -lm is the linker command that to find the ''libm.xxx'' while linking, the xxx is depends on platform. (In linux is .a)