Hi coders, I have simple questions to ask :-
If I run the Alert, the output is "Results : 60.00000 / 57.00000", my questions are :-
1) I'm expecting the output would be the same 57.27273 for both rad1 and rad2.
2) 180/(22/7) is in fact = 180*7/22, why there are different answers : 60.00000 and 57.00000 ?
Is there any way(s) to get the correct output of 57.27273 for both rad1 and rad2 ? Thanks
Inserted Code
double rad1=180/(22/7); // Expecting 57.27273 double rad2=180*7/22; // Expecting 57.27273 {Alert("Results : "+DoubleToStr(rad1,5)+" / "+DoubleToStr(rad2,5));}
If I run the Alert, the output is "Results : 60.00000 / 57.00000", my questions are :-
1) I'm expecting the output would be the same 57.27273 for both rad1 and rad2.
2) 180/(22/7) is in fact = 180*7/22, why there are different answers : 60.00000 and 57.00000 ?
Is there any way(s) to get the correct output of 57.27273 for both rad1 and rad2 ? Thanks