lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6577] Restore std::cout precision after changing it (VZ)


From: gchicares
Subject: [lmi-commits] [6577] Restore std::cout precision after changing it (VZ)
Date: Wed, 11 May 2016 17:13:16 +0000 (UTC)

Revision: 6577
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6577
Author:   chicares
Date:     2016-05-11 17:13:15 +0000 (Wed, 11 May 2016)
Log Message:
-----------
Restore std::cout precision after changing it (VZ)

Modified Paths:
--------------
    lmi/trunk/ihs_crc_comp.cpp

Modified: lmi/trunk/ihs_crc_comp.cpp
===================================================================
--- lmi/trunk/ihs_crc_comp.cpp  2016-05-11 17:00:09 UTC (rev 6576)
+++ lmi/trunk/ihs_crc_comp.cpp  2016-05-11 17:13:15 UTC (rev 6577)
@@ -317,11 +317,13 @@
     std::cout
         << current_name
         << '\n';
+    std::streamsize const original_precision = std::cout.precision();
     std::cout
         << std::setprecision(20)
         << rel_err
         << "  " << d1
         << " vs. " << d2
+        << std::setprecision(original_precision)
         << '\n';
 }
 
@@ -475,11 +477,13 @@
         return EXIT_FAILURE;
         }
 
+    std::streamsize const original_precision = std::cout.precision();
     std::cout
         << std::setprecision(6) << std::setw(12)
         << "Summary:"
         << " max abs diff: " << max_abs_diff
         << " max rel err:  " << max_rel_err
+        << std::setprecision(original_precision)
         << '\n';
 
     is1.close();




reply via email to

[Prev in Thread] Current Thread [Next in Thread]