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.

TMS320F2800157: issue about using sinf and cosf

Part Number: TMS320F2800157


Hi Team,

Here are some issues about sinf and cosf function need your help:

1. Some results are correct, and some of it are incorrect. What is the reason?

#define CONST_PI_32     3.14159265358979323846f
float32_t tmp;
tmp = (float32_t)sinf(CONST_PI_32/4);                 // 0.707106769,correct
tmp = (float32_t)sinf(CONST_PI_32/4 + CONST_PI_32/5); // 0.987298429
tmp = (float32_t)sinf(CONST_PI_32/4 + CONST_PI_32/4); // 1.0, correct
tmp = (float32_t)sinf(CONST_PI_32/4 + CONST_PI_32/3); // 0.0, incorrect
tmp = (float32_t)cosf(CONST_PI_32/4);                 // 0.0, incorrect
tmp = (float32_t)cosf(CONST_PI_32/4 + CONST_PI_32/5); // -0.00242325524, correct or not?
tmp = (float32_t)cosf(CONST_PI_32/4 + CONST_PI_32/4); // 0.0, correct
tmp = (float32_t)cosf(CONST_PI_32/4 + CONST_PI_32/3); // 0.0, incorrect

2. Are the parameter range of sinf and cosf from (-Pi) to (Pi)?

--

Thanks & Regards