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.

sine sosine

Hi.

I have a problem with the accuracy of sin() cos() math functions.

#include <math.h>

#define PI 3.14159

double a;

 a = sin(45 * PI / 180);     // a gives the result 0.785 instead of 0.707 .

 a = sin(30 * PI / 180);     // a gives the result 0.523 instead of 0.5

 

Please Advise.

Ephraim Oved.