You are viewing a single comment's thread. Return to all comments →
For some reason beyond my understanding, the test cases will not pass if you don't set the precision for float to 3 and double to 9.
You can do this by including and using setprecision() while printing like this:
cout << setprecision( 3 ) << fixed << floatVar << endl;
cout << setprecision( 9 ) << fixed << doubleVar << endl;
Seems like cookies are disabled on this browser, please enable them to open this website
Basic Data Types
You are viewing a single comment's thread. Return to all comments →
MAKE SURE YOU READ THIS BEFORE SUBMITTING.
For some reason beyond my understanding, the test cases will not pass if you don't set the precision for float to 3 and double to 9.
You can do this by including and using setprecision() while printing like this:
cout << setprecision( 3 ) << fixed << floatVar << endl;
cout << setprecision( 9 ) << fixed << doubleVar << endl;