diff src/ls-oct-ascii.cc @ 5951:b2167e370f82

[project @ 2006-08-22 05:13:42 by jwe]
author jwe
date Tue, 22 Aug 2006 05:13:42 +0000
parents 1138ced03f14
children cdef72fcd206
line wrap: on
line diff
--- a/src/ls-oct-ascii.cc	Tue Aug 22 04:42:36 2006 +0000
+++ b/src/ls-oct-ascii.cc	Tue Aug 22 05:13:42 2006 +0000
@@ -68,7 +68,7 @@
 #include "ls-oct-ascii.h"
 
 // The number of decimal digits to use when writing ascii data.
-static int Vsave_precision = 15;
+static int Vsave_precision = 16;
 
 // Functions for reading ascii data.
 
@@ -357,15 +357,9 @@
 {
   bool success = true;
 
-  if (! precision)
-    precision = Vsave_precision;
-
   if (! name.empty ())
     os << "# name: " << name << "\n";
 
-  long old_precision = os.precision ();
-  os.precision (precision);
-
   octave_value val = val_arg;
 
   if (mark_as_global)
@@ -373,7 +367,13 @@
   else
     os << "# type: " << val.type_name() << "\n";
 
-  success = val . save_ascii(os, infnan_warned, strip_nan_and_inf);
+  if (! precision)
+    precision = Vsave_precision;
+
+  long old_precision = os.precision ();
+  os.precision (precision);
+
+  success = val . save_ascii (os, infnan_warned, strip_nan_and_inf);
 
   os.precision (old_precision);