As far as I can gather the output format can either be in fixed, scientific or default mode.
I don't want scientific mode, so that is out.
When using fixed mode (std::fixed
) std::cout.precision(15)
will leave trailing zeros.
When using default mode (std::defaultfloat
) std::cout.precision(15)
doesn't affect anything - e.g. after 6 decimal places it still switches to scientific format.
Basically, I would like
std::cout << 0.1 << std::endl;
std::cout << 0.0000001 << std::endl;
to print
0.1
0.0000001