From: Kevin M. Rosenberg Date: Thu, 22 Mar 2018 00:40:45 +0000 (-0600) Subject: Use setprecision for std::cout X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=commitdiff_plain;h=fb17e4a8130583e4d7a911fdaa70782561cd6a3e Use setprecision for std::cout --- diff --git a/libctsim/imagefile.cpp b/libctsim/imagefile.cpp index 8710e5a..623b4e3 100644 --- a/libctsim/imagefile.cpp +++ b/libctsim/imagefile.cpp @@ -264,6 +264,7 @@ ImageFile::printStatistics (std::ostream& os) const if (isComplex()) os << "Real Component Statistics" << std::endl; + os << std::setprecision(7); os << " min: " << min << std::endl; os << " max: " << max << std::endl; os << " mean: " << mean << std::endl; diff --git a/tools/if2.cpp b/tools/if2.cpp index efd0554..b264046 100644 --- a/tools/if2.cpp +++ b/tools/if2.cpp @@ -219,7 +219,8 @@ if2_main (int argc, char *const argv[]) if (opt_comp) { double d, r, e; im_in1.comparativeStatistics (im_in2, d, r, e); - std::cout << "d=" << d << ", r=" << r << ", e=" << e << std::endl; + std::cout << std::setprecision(7) << + "d=" << d << ", r=" << r << ", e=" << e << std::endl; } int i;