1. ## Borland bug

Hey try this:

Code:
```#include <iostream.h>
#include <math.h>

int main(void)
{
cout << cos(90);
return 0;
}```
The answer I get is -0.448074, instead of 0. This seems to be consistent throughout all Borland compilers, even with their latest release. It's seriously ruining my matrix calculations. Any thoughts?

2. I'm just guessing, but it looks like the cos() uses radians. Try

Code:
```#include <iostream.h>
#include <math.h>
#define PI 3.141592654

int main(void)
{
cout << cos(PI/2);
return 0;
}```

3. >The answer I get is -0.448074.
And this is unexpected, how?

>but it looks like the cos() uses radians
Yes, it does. This is well documented too.

4. also, try something like this:

Code:
```float cosdeg(float deg)
{
return cos(deg * (PI/180));
}```
Try using that function with degrees (like 90 in your example). I'm surprised if borland's math.h doesn't have trig functions that use degrees.

5. Originally posted by Prelude
>>but it looks like the cos() uses radians
Yes, it does. This is well documented too.
Sorry Prelude, haven't used them so wouldn't know. Was just guessing.

6. Checked my Borland compiler. It doesn't say anything about cos() using deg or rad parameters, so I assumed it's deg. However, the acos() function returns a radian, so now I'm kinda confused. I'll try your cosdeg() idea neandrake.

7. Great, tell me how it goes

8. Hey you guys are right. Borland trig functions accept radians as parameter inputs. And that means some of my programs I submitted in class 2 years ago were incorrect

Anyway, here's my modified code. Thanks for your info.

Code:
```#include <iostream.h>
#include <math.h>

#define PI            acos(-1)
#define deg(x)     (x * PI/180)  //x is in degrees

int main(void)
{
cout << cos(deg(90));
return 0;
}```

9. > And that means some of my programs I submitted in class 2 years ago were incorrect
Should you be worried if your tutors failed to spot them?
How wrong could a program be before they notice I wonder...

10. >>Should you be worried if your tutors failed to spot them?<<

I know They were too fascinated with my GUI's to even notice it.