Use setprecision for std::cout
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 22 Mar 2018 00:40:45 +0000 (18:40 -0600)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 22 Mar 2018 00:40:45 +0000 (18:40 -0600)
libctsim/imagefile.cpp
tools/if2.cpp

index 8710e5a002eae10c85804ec1aee911b7c8e66d22..623b4e32c265de5b75abdc46531bab1088b546ab 100644 (file)
@@ -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;
index efd0554780c323a9349aacedb04b2a529c0d47f9..b264046360d4437c333d0e5750da553fcc0d1efe 100644 (file)
@@ -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;