This may be a duplicate of this question, but I don't feel it was actually answered correctly. Observe:
#include <iostream>
#include <iomanip>
using namespace std;
int main () {
float p = 1.00;
cout << showpoint << setprecision(3) << p << endl;
}
Output: 1.00
Now if we change that line to:
cout << fixed << showpoint << setprecision(3) << p << endl;
we get: 1.000
And if we use the "opposite" of fixed we get something totally different:
cout << scientific << showpoint << setprecision(3) << p << endl;
Output: 1.000e+00
How can I go back to the behaviour of the first version after fixed
has been set?