Hi,
I created a CCSv6 C++ project based on F2812, tried to use 'abs' function but failed, the error is:
#20 identifier "abs" is undefined
I tried to include IQMathLib.h and <math.h> but neither works. What do I missed?
Any comments are appreciated.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
I created a CCSv6 C++ project based on F2812, tried to use 'abs' function but failed, the error is:
#20 identifier "abs" is undefined
I tried to include IQMathLib.h and <math.h> but neither works. What do I missed?
Any comments are appreciated.
Hello,
abs() can be used in C++ by including <stdlib.h>. You could also use the intrinsic __abs16_sat to take the 16-bit absolute value.
More information on the C28x support of C++ in section 6.2 of www.ti.com/.../spru514h.pdf
More information on supported intrinsics in section 7.5.6.
Edited for correctness.
Best Regards,
Chris