I need to find the cosine of a number. The problem is, when I use the cos function, I need to convert from degrees to radians and the number I receive isn't necessarily accurate when you do something like
cos(90 * (pi/180) )
It will give you .32679e-006 which is: .00000032679.
I only need the first few decimal places since the answer is supposed to be exactly zero.
I know I can output
cout << fixed << setprecision (3) << cos(90 * (pi/180)) << endl;
to whatever amount of places I need. In this case 4 should be ok without losing accuracy. Any ideas?
Need to input to certain amount of places
Moderator: Coders of Rage