comparison libinterp/corefcn/pr-output.cc @ 17787:175b392e91fe

Use GNU style coding conventions for code in libinterp/ * libinterp/corefcn/Cell.h, libinterp/corefcn/__contourc__.cc, libinterp/corefcn/__dispatch__.cc, libinterp/corefcn/__lin_interpn__.cc, libinterp/corefcn/__pchip_deriv__.cc, libinterp/corefcn/__qp__.cc, libinterp/corefcn/balance.cc, libinterp/corefcn/besselj.cc, libinterp/corefcn/betainc.cc, libinterp/corefcn/bitfcns.cc, libinterp/corefcn/bsxfun.cc, libinterp/corefcn/c-file-ptr-stream.cc, libinterp/corefcn/c-file-ptr-stream.h, libinterp/corefcn/cellfun.cc, libinterp/corefcn/colloc.cc, libinterp/corefcn/comment-list.h, libinterp/corefcn/conv2.cc, libinterp/corefcn/daspk.cc, libinterp/corefcn/dasrt.cc, libinterp/corefcn/dassl.cc, libinterp/corefcn/data.cc, libinterp/corefcn/debug.cc, libinterp/corefcn/defaults.cc, libinterp/corefcn/defaults.in.h, libinterp/corefcn/defun-int.h, libinterp/corefcn/defun.cc, libinterp/corefcn/det.cc, libinterp/corefcn/dirfns.cc, libinterp/corefcn/display.cc, libinterp/corefcn/dlmread.cc, libinterp/corefcn/dot.cc, libinterp/corefcn/dynamic-ld.cc, libinterp/corefcn/dynamic-ld.h, libinterp/corefcn/eig.cc, libinterp/corefcn/ellipj.cc, libinterp/corefcn/error.cc, libinterp/corefcn/error.h, libinterp/corefcn/event-queue.h, libinterp/corefcn/fft.cc, libinterp/corefcn/fft2.cc, libinterp/corefcn/fftn.cc, libinterp/corefcn/file-io.cc, libinterp/corefcn/filter.cc, libinterp/corefcn/find.cc, libinterp/corefcn/gammainc.cc, libinterp/corefcn/gcd.cc, libinterp/corefcn/getgrent.cc, libinterp/corefcn/getpwent.cc, libinterp/corefcn/getrusage.cc, libinterp/corefcn/givens.cc, libinterp/corefcn/gl-render.cc, libinterp/corefcn/gl2ps-renderer.cc, libinterp/corefcn/gl2ps-renderer.h, libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h, libinterp/corefcn/gripes.cc, libinterp/corefcn/gripes.h, libinterp/corefcn/help.cc, libinterp/corefcn/hess.cc, libinterp/corefcn/hex2num.cc, libinterp/corefcn/input.cc, libinterp/corefcn/input.h, libinterp/corefcn/inv.cc, libinterp/corefcn/jit-ir.h, libinterp/corefcn/jit-typeinfo.cc, libinterp/corefcn/jit-typeinfo.h, libinterp/corefcn/jit-util.h, libinterp/corefcn/kron.cc, libinterp/corefcn/load-path.cc, libinterp/corefcn/load-path.h, libinterp/corefcn/load-save.cc, libinterp/corefcn/load-save.h, libinterp/corefcn/lookup.cc, libinterp/corefcn/ls-ascii-helper.cc, libinterp/corefcn/ls-hdf5.cc, libinterp/corefcn/ls-hdf5.h, libinterp/corefcn/ls-mat-ascii.cc, libinterp/corefcn/ls-mat-ascii.h, libinterp/corefcn/ls-mat4.cc, libinterp/corefcn/ls-mat5.cc, libinterp/corefcn/ls-mat5.h, libinterp/corefcn/ls-oct-ascii.cc, libinterp/corefcn/lsode.cc, libinterp/corefcn/lu.cc, libinterp/corefcn/luinc.cc, libinterp/corefcn/mappers.cc, libinterp/corefcn/matrix_type.cc, libinterp/corefcn/max.cc, libinterp/corefcn/md5sum.cc, libinterp/corefcn/mex.cc, libinterp/corefcn/mexproto.h, libinterp/corefcn/mgorth.cc, libinterp/corefcn/mxarray.in.h, libinterp/corefcn/nproc.cc, libinterp/corefcn/oct-hist.cc, libinterp/corefcn/oct-lvalue.h, libinterp/corefcn/oct-map.cc, libinterp/corefcn/oct-map.h, libinterp/corefcn/oct-obj.h, libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-stdstrm.h, libinterp/corefcn/oct-stream.cc, libinterp/corefcn/oct-stream.h, libinterp/corefcn/octave-link.cc, libinterp/corefcn/octave-link.h, libinterp/corefcn/pager.cc, libinterp/corefcn/pinv.cc, libinterp/corefcn/pr-output.cc, libinterp/corefcn/procstream.h, libinterp/corefcn/profiler.cc, libinterp/corefcn/pt-jit.cc, libinterp/corefcn/pt-jit.h, libinterp/corefcn/quad.cc, libinterp/corefcn/quadcc.cc, libinterp/corefcn/qz.cc, libinterp/corefcn/rand.cc, libinterp/corefcn/rcond.cc, libinterp/corefcn/regexp.cc, libinterp/corefcn/schur.cc, libinterp/corefcn/sighandlers.cc, libinterp/corefcn/sighandlers.h, libinterp/corefcn/sparse-xdiv.cc, libinterp/corefcn/sparse-xdiv.h, libinterp/corefcn/sparse-xpow.cc, libinterp/corefcn/sparse.cc, libinterp/corefcn/spparms.cc, libinterp/corefcn/sqrtm.cc, libinterp/corefcn/str2double.cc, libinterp/corefcn/strfind.cc, libinterp/corefcn/strfns.cc, libinterp/corefcn/sub2ind.cc, libinterp/corefcn/svd.cc, libinterp/corefcn/syl.cc, libinterp/corefcn/symtab.cc, libinterp/corefcn/symtab.h, libinterp/corefcn/syscalls.cc, libinterp/corefcn/sysdep.cc, libinterp/corefcn/sysdep.h, libinterp/corefcn/time.cc, libinterp/corefcn/toplev.cc, libinterp/corefcn/toplev.h, libinterp/corefcn/tril.cc, libinterp/corefcn/txt-eng-ft.cc, libinterp/corefcn/txt-eng-ft.h, libinterp/corefcn/txt-eng.h, libinterp/corefcn/typecast.cc, libinterp/corefcn/urlwrite.cc, libinterp/corefcn/utils.cc, libinterp/corefcn/variables.cc, libinterp/corefcn/variables.h, libinterp/corefcn/xdiv.cc, libinterp/corefcn/xdiv.h, libinterp/corefcn/xnorm.h, libinterp/corefcn/xpow.cc, libinterp/corefcn/xpow.h, libinterp/corefcn/zfstream.cc, libinterp/corefcn/zfstream.h, libinterp/dldfcn/__delaunayn__.cc, libinterp/dldfcn/__dsearchn__.cc, libinterp/dldfcn/__eigs__.cc, libinterp/dldfcn/__fltk_uigetfile__.cc, libinterp/dldfcn/__glpk__.cc, libinterp/dldfcn/__init_fltk__.cc, libinterp/dldfcn/__init_gnuplot__.cc, libinterp/dldfcn/__magick_read__.cc, libinterp/dldfcn/__voronoi__.cc, libinterp/dldfcn/amd.cc, libinterp/dldfcn/ccolamd.cc, libinterp/dldfcn/chol.cc, libinterp/dldfcn/colamd.cc, libinterp/dldfcn/convhulln.cc, libinterp/dldfcn/dmperm.cc, libinterp/dldfcn/fftw.cc, libinterp/dldfcn/qr.cc, libinterp/dldfcn/symbfact.cc, libinterp/dldfcn/symrcm.cc, libinterp/dldfcn/tsearch.cc, libinterp/octave-value/ov-base-diag.cc, libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.cc, libinterp/octave-value/ov-base-int.h, libinterp/octave-value/ov-base-mat.h, libinterp/octave-value/ov-base-scalar.cc, libinterp/octave-value/ov-base-scalar.h, libinterp/octave-value/ov-base-sparse.cc, libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.cc, libinterp/octave-value/ov-base.h, libinterp/octave-value/ov-bool-mat.cc, libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.cc, libinterp/octave-value/ov-bool-sparse.h, libinterp/octave-value/ov-bool.cc, libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.cc, libinterp/octave-value/ov-builtin.h, libinterp/octave-value/ov-cell.cc, libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.cc, libinterp/octave-value/ov-ch-mat.h, libinterp/octave-value/ov-class.cc, libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-colon.h, libinterp/octave-value/ov-complex.cc, libinterp/octave-value/ov-complex.h, libinterp/octave-value/ov-cx-diag.cc, libinterp/octave-value/ov-cx-diag.h, libinterp/octave-value/ov-cx-mat.cc, libinterp/octave-value/ov-cx-mat.h, libinterp/octave-value/ov-cx-sparse.cc, libinterp/octave-value/ov-cx-sparse.h, libinterp/octave-value/ov-dld-fcn.h, libinterp/octave-value/ov-fcn-handle.cc, libinterp/octave-value/ov-fcn-handle.h, libinterp/octave-value/ov-fcn-inline.cc, libinterp/octave-value/ov-fcn-inline.h, libinterp/octave-value/ov-fcn.h, libinterp/octave-value/ov-float.cc, libinterp/octave-value/ov-float.h, libinterp/octave-value/ov-flt-complex.cc, libinterp/octave-value/ov-flt-complex.h, libinterp/octave-value/ov-flt-cx-diag.cc, libinterp/octave-value/ov-flt-cx-diag.h, libinterp/octave-value/ov-flt-cx-mat.cc, libinterp/octave-value/ov-flt-cx-mat.h, libinterp/octave-value/ov-flt-re-diag.cc, libinterp/octave-value/ov-flt-re-diag.h, libinterp/octave-value/ov-flt-re-mat.cc, libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int16.cc, libinterp/octave-value/ov-int32.cc, libinterp/octave-value/ov-int64.cc, libinterp/octave-value/ov-int8.cc, libinterp/octave-value/ov-intx.h, libinterp/octave-value/ov-java.cc, libinterp/octave-value/ov-lazy-idx.h, libinterp/octave-value/ov-mex-fcn.cc, libinterp/octave-value/ov-mex-fcn.h, libinterp/octave-value/ov-null-mat.cc, libinterp/octave-value/ov-null-mat.h, libinterp/octave-value/ov-oncleanup.cc, libinterp/octave-value/ov-perm.cc, libinterp/octave-value/ov-perm.h, libinterp/octave-value/ov-range.cc, libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-diag.cc, libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.cc, libinterp/octave-value/ov-re-mat.h, libinterp/octave-value/ov-re-sparse.cc, libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.cc, libinterp/octave-value/ov-scalar.h, libinterp/octave-value/ov-str-mat.cc, libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.cc, libinterp/octave-value/ov-struct.h, libinterp/octave-value/ov-type-conv.h, libinterp/octave-value/ov-typeinfo.cc, libinterp/octave-value/ov-typeinfo.h, libinterp/octave-value/ov-uint16.cc, libinterp/octave-value/ov-uint32.cc, libinterp/octave-value/ov-uint64.cc, libinterp/octave-value/ov-uint8.cc, libinterp/octave-value/ov-usr-fcn.cc, libinterp/octave-value/ov-usr-fcn.h, libinterp/octave-value/ov.cc, libinterp/octave-value/ov.h, libinterp/octave.cc, libinterp/operators/op-b-bm.cc, libinterp/operators/op-b-sbm.cc, libinterp/operators/op-bm-b.cc, libinterp/operators/op-bm-bm.cc, libinterp/operators/op-cdm-cdm.cc, libinterp/operators/op-chm.cc, libinterp/operators/op-class.cc, libinterp/operators/op-cm-cm.cc, libinterp/operators/op-cm-cs.cc, libinterp/operators/op-cm-s.cc, libinterp/operators/op-cm-scm.cc, libinterp/operators/op-cm-sm.cc, libinterp/operators/op-cs-cm.cc, libinterp/operators/op-cs-cs.cc, libinterp/operators/op-cs-scm.cc, libinterp/operators/op-cs-sm.cc, libinterp/operators/op-dm-dm.cc, libinterp/operators/op-dm-scm.cc, libinterp/operators/op-double-conv.cc, libinterp/operators/op-fcdm-fcdm.cc, libinterp/operators/op-fcm-fcm.cc, libinterp/operators/op-fcm-fcs.cc, libinterp/operators/op-fcm-fm.cc, libinterp/operators/op-fcm-fs.cc, libinterp/operators/op-fcs-fcm.cc, libinterp/operators/op-fcs-fcs.cc, libinterp/operators/op-fcs-fm.cc, libinterp/operators/op-fcs-fs.cc, libinterp/operators/op-fdm-fdm.cc, libinterp/operators/op-float-conv.cc, libinterp/operators/op-fm-fcm.cc, libinterp/operators/op-fm-fcs.cc, libinterp/operators/op-fm-fm.cc, libinterp/operators/op-fm-fs.cc, libinterp/operators/op-fs-fcm.cc, libinterp/operators/op-fs-fcs.cc, libinterp/operators/op-fs-fm.cc, libinterp/operators/op-fs-fs.cc, libinterp/operators/op-m-cm.cc, libinterp/operators/op-m-cs.cc, libinterp/operators/op-m-m.cc, libinterp/operators/op-m-s.cc, libinterp/operators/op-m-scm.cc, libinterp/operators/op-m-sm.cc, libinterp/operators/op-pm-scm.cc, libinterp/operators/op-range.cc, libinterp/operators/op-s-cm.cc, libinterp/operators/op-s-cs.cc, libinterp/operators/op-s-scm.cc, libinterp/operators/op-sbm-b.cc, libinterp/operators/op-sbm-bm.cc, libinterp/operators/op-sbm-sbm.cc, libinterp/operators/op-scm-cm.cc, libinterp/operators/op-scm-cs.cc, libinterp/operators/op-scm-m.cc, libinterp/operators/op-scm-s.cc, libinterp/operators/op-scm-scm.cc, libinterp/operators/op-scm-sm.cc, libinterp/operators/op-sm-cm.cc, libinterp/operators/op-sm-m.cc, libinterp/operators/op-sm-s.cc, libinterp/operators/op-sm-scm.cc, libinterp/operators/op-sm-sm.cc, libinterp/operators/op-str-m.cc, libinterp/operators/op-str-s.cc, libinterp/operators/op-str-str.cc, libinterp/operators/ops.h, libinterp/parse-tree/lex.h, libinterp/parse-tree/parse.h, libinterp/parse-tree/pt-arg-list.cc, libinterp/parse-tree/pt-arg-list.h, libinterp/parse-tree/pt-assign.cc, libinterp/parse-tree/pt-assign.h, libinterp/parse-tree/pt-binop.cc, libinterp/parse-tree/pt-binop.h, libinterp/parse-tree/pt-bp.h, libinterp/parse-tree/pt-cbinop.cc, libinterp/parse-tree/pt-check.cc, libinterp/parse-tree/pt-colon.cc, libinterp/parse-tree/pt-colon.h, libinterp/parse-tree/pt-const.cc, libinterp/parse-tree/pt-decl.cc, libinterp/parse-tree/pt-decl.h, libinterp/parse-tree/pt-eval.cc, libinterp/parse-tree/pt-except.h, libinterp/parse-tree/pt-exp.h, libinterp/parse-tree/pt-fcn-handle.cc, libinterp/parse-tree/pt-id.cc, libinterp/parse-tree/pt-id.h, libinterp/parse-tree/pt-idx.cc, libinterp/parse-tree/pt-idx.h, libinterp/parse-tree/pt-loop.h, libinterp/parse-tree/pt-mat.cc, libinterp/parse-tree/pt-misc.cc, libinterp/parse-tree/pt-misc.h, libinterp/parse-tree/pt-pr-code.cc, libinterp/parse-tree/pt-select.h, libinterp/parse-tree/pt-stmt.h, libinterp/parse-tree/token.h, libinterp/version.cc: Use GNU style coding conventions for code in libinterp/
author Rik <rik@octave.org>
date Mon, 28 Oct 2013 19:51:46 -0700
parents d63878346099
children f1b59ef34eda
comparison
equal deleted inserted replaced
17786:34d9812a943b 17787:175b392e91fe
144 144
145 float_format (int w, int e, int p, int f) 145 float_format (int w, int e, int p, int f)
146 : fw (w), ex (e), prec (p), fmt (f), up (0), sp (0) { } 146 : fw (w), ex (e), prec (p), fmt (f), up (0), sp (0) { }
147 147
148 float_format (const float_format& ff) 148 float_format (const float_format& ff)
149 : fw (ff.fw), ex (ff.ex), prec (ff.prec), fmt (ff.fmt), up (ff.up), sp (ff.sp) { } 149 : fw (ff.fw), ex (ff.ex), prec (ff.prec), fmt (ff.fmt), up (ff.up),
150 sp (ff.sp) { }
150 151
151 float_format& operator = (const float_format& ff) 152 float_format& operator = (const float_format& ff)
152 { 153 {
153 if (&ff != this) 154 if (&ff != this)
154 { 155 {
155 fw = ff.fw; 156 fw = ff.fw;
156 ex = ff.ex; 157 ex = ff.ex;
157 prec = ff.prec; 158 prec = ff.prec;
158 fmt = ff.fmt; 159 fmt = ff.fmt;
159 up = ff.up; 160 up = ff.up;
160 sp = ff.sp; 161 sp = ff.sp;
161 } 162 }
162 163
163 return *this; 164 return *this;
164 } 165 }
165 166
166 ~float_format (void) { } 167 ~float_format (void) { }
167 168
168 float_format& scientific (void) { fmt = std::ios::scientific; return *this; } 169 float_format& scientific (void) { fmt = std::ios::scientific; return *this; }
169 float_format& fixed (void) { fmt = std::ios::fixed; return *this; } 170 float_format& fixed (void) { fmt = std::ios::fixed; return *this; }
175 float_format& precision (int p) { prec = p; return *this; } 176 float_format& precision (int p) { prec = p; return *this; }
176 177
177 float_format& width (int w) { fw = w; return *this; } 178 float_format& width (int w) { fw = w; return *this; }
178 179
179 float_format& trailing_zeros (bool tz = true) 180 float_format& trailing_zeros (bool tz = true)
180 { sp = tz ? std::ios::showpoint : 0; return *this; } 181 { sp = tz ? std::ios::showpoint : 0; return *this; }
181 182
182 friend std::ostream& operator << (std::ostream& os, 183 friend std::ostream& operator << (std::ostream& os,
183 const pr_engineering_float& pef); 184 const pr_engineering_float& pef);
184 185
185 friend std::ostream& operator << (std::ostream& os, 186 friend std::ostream& operator << (std::ostream& os,
385 double step = xround (flip); 386 double step = xround (flip);
386 double nextn = n; 387 double nextn = n;
387 double nextd = d; 388 double nextd = d;
388 389
389 // Have we converged to 1/intmax ? 390 // Have we converged to 1/intmax ?
390 if (m > 100 || fabs (frac) < 1 / static_cast<double> (std::numeric_limits<int>::max ())) 391 if (m > 100
392 || fabs (frac) < 1 / static_cast<double> (std::numeric_limits<int>::max ()))
391 { 393 {
392 lastn = n; 394 lastn = n;
393 lastd = d; 395 lastd = d;
394 break; 396 break;
395 } 397 }
426 lastd = - lastd; 428 lastd = - lastd;
427 lastn = - lastn; 429 lastn = - lastn;
428 std::ostringstream buf; 430 std::ostringstream buf;
429 buf.flags (std::ios::fixed); 431 buf.flags (std::ios::fixed);
430 buf << std::setprecision (0) << static_cast<int>(lastn) 432 buf << std::setprecision (0) << static_cast<int>(lastn)
431 << "/" << static_cast<int>(lastd); 433 << "/" << static_cast<int>(lastd);
432 s = buf.str (); 434 s = buf.str ();
433 } 435 }
434 } 436 }
435 437
436 return s; 438 return s;
535 result = 0.0; 537 result = 0.0;
536 538
537 return result; 539 return result;
538 } 540 }
539 541
540 // FIXME -- it would be nice to share more code among these 542 // FIXME: it would be nice to share more code among these functions,..
541 // functions,..
542 543
543 static void 544 static void
544 set_real_format (int digits, bool inf_or_nan, bool int_only, int &fw) 545 set_real_format (int digits, bool inf_or_nan, bool int_only, int &fw)
545 { 546 {
546 static float_format fmt; 547 static float_format fmt;
650 651
651 bool int_only = (! inf_or_nan && D_NINT (d) == d); 652 bool int_only = (! inf_or_nan && D_NINT (d) == d);
652 653
653 double d_abs = d < 0.0 ? -d : d; 654 double d_abs = d < 0.0 ? -d : d;
654 655
655 int digits = (inf_or_nan || d_abs == 0.0) 656 int digits = (inf_or_nan || d_abs == 0.0) ? 0 : num_digits (d_abs);
656 ? 0 : num_digits (d_abs);
657 657
658 set_real_format (digits, inf_or_nan, int_only, fw); 658 set_real_format (digits, inf_or_nan, int_only, fw);
659 } 659 }
660 660
661 static inline void 661 static inline void
810 810
811 int x_max = max_abs == 0.0 ? 0 : num_digits (max_abs); 811 int x_max = max_abs == 0.0 ? 0 : num_digits (max_abs);
812 812
813 int x_min = min_abs == 0.0 ? 0 : num_digits (min_abs); 813 int x_min = min_abs == 0.0 ? 0 : num_digits (min_abs);
814 814
815 scale = (x_max == 0 || int_or_inf_or_nan) ? 1.0 815 scale = (x_max == 0 || int_or_inf_or_nan)
816 : std::pow (10.0, calc_scale_exp (x_max - 1)); 816 ? 1.0 : std::pow (10.0, calc_scale_exp (x_max - 1));
817 817
818 set_real_matrix_format (x_max, x_min, inf_or_nan, int_or_inf_or_nan, fw); 818 set_real_matrix_format (x_max, x_min, inf_or_nan, int_or_inf_or_nan, fw);
819 } 819 }
820 820
821 static inline void 821 static inline void
1226 int i_x_min = i_min_abs == 0.0 ? 0 : num_digits (i_min_abs); 1226 int i_x_min = i_min_abs == 0.0 ? 0 : num_digits (i_min_abs);
1227 1227
1228 int x_max = r_x_max > i_x_max ? r_x_max : i_x_max; 1228 int x_max = r_x_max > i_x_max ? r_x_max : i_x_max;
1229 int x_min = r_x_min > i_x_min ? r_x_min : i_x_min; 1229 int x_min = r_x_min > i_x_min ? r_x_min : i_x_min;
1230 1230
1231 scale = (x_max == 0 || int_or_inf_or_nan) ? 1.0 1231 scale = (x_max == 0 || int_or_inf_or_nan)
1232 : std::pow (10.0, calc_scale_exp (x_max - 1)); 1232 ? 1.0 : std::pow (10.0, calc_scale_exp (x_max - 1));
1233 1233
1234 set_complex_matrix_format (x_max, x_min, r_x_max, r_x_min, inf_or_nan, 1234 set_complex_matrix_format (x_max, x_min, r_x_max, r_x_min, inf_or_nan,
1235 int_or_inf_or_nan, r_fw, i_fw); 1235 int_or_inf_or_nan, r_fw, i_fw);
1236 } 1236 }
1237 1237
1382 1382
1383 int x_max = max_abs == 0.0 ? 0 : num_digits (max_abs); 1383 int x_max = max_abs == 0.0 ? 0 : num_digits (max_abs);
1384 1384
1385 int x_min = min_abs == 0.0 ? 0 : num_digits (min_abs); 1385 int x_min = min_abs == 0.0 ? 0 : num_digits (min_abs);
1386 1386
1387 scale = (x_max == 0 || all_ints) ? 1.0 1387 scale = (x_max == 0 || all_ints)
1388 : std::pow (10.0, calc_scale_exp (x_max - 1)); 1388 ? 1.0 : std::pow (10.0, calc_scale_exp (x_max - 1));
1389 1389
1390 set_range_format (x_max, x_min, all_ints, fw); 1390 set_range_format (x_max, x_min, all_ints, fw);
1391 } 1391 }
1392 1392
1393 static inline void 1393 static inline void
1443 static void 1443 static void
1444 pr_any_float (const float_format *fmt, std::ostream& os, double d, int fw = 0) 1444 pr_any_float (const float_format *fmt, std::ostream& os, double d, int fw = 0)
1445 { 1445 {
1446 if (fmt) 1446 if (fmt)
1447 { 1447 {
1448 // Unless explicitly asked for, always print in big-endian 1448 // Unless explicitly asked for, always print in big-endian format
1449 // format for hex and bit formats. 1449 // for hex and bit formats.
1450 // 1450 //
1451 // {bit,hex}_format == 1: print big-endian 1451 // {bit,hex}_format == 1: print big-endian
1452 // {bit,hex}_format == 2: print native 1452 // {bit,hex}_format == 2: print native
1453 1453
1454 if (hex_format) 1454 if (hex_format)
1455 { 1455 {
1456 equiv tmp; 1456 equiv tmp;
1457 tmp.d = d; 1457 tmp.d = d;
1458 1458
1459 // Unless explicitly asked for, always print in big-endian 1459 // Unless explicitly asked for, always print in big-endian format.
1460 // format. 1460
1461 1461 // FIXME: will bad things happen if we are
1462 // FIXME -- will bad things happen if we are
1463 // interrupted before resetting the format flags and fill 1462 // interrupted before resetting the format flags and fill
1464 // character? 1463 // character?
1465 1464
1466 oct_mach_info::float_format flt_fmt = 1465 oct_mach_info::float_format flt_fmt =
1467 oct_mach_info::native_float_format (); 1466 oct_mach_info::native_float_format ();
1598 os << "i"; 1597 os << "i";
1599 } 1598 }
1600 } 1599 }
1601 1600
1602 static void 1601 static void
1603 print_empty_matrix (std::ostream& os, octave_idx_type nr, octave_idx_type nc, bool pr_as_read_syntax) 1602 print_empty_matrix (std::ostream& os, octave_idx_type nr, octave_idx_type nc,
1603 bool pr_as_read_syntax)
1604 { 1604 {
1605 assert (nr == 0 || nc == 0); 1605 assert (nr == 0 || nc == 0);
1606 1606
1607 if (pr_as_read_syntax) 1607 if (pr_as_read_syntax)
1608 { 1608 {
1937 } 1937 }
1938 1938
1939 col += inc; 1939 col += inc;
1940 1940
1941 if (col >= nc) 1941 if (col >= nc)
1942 os << " ]"; 1942 os << " ]";
1943 else 1943 else
1944 os << " ...\n"; 1944 os << " ...\n";
1945 } 1945 }
1946 os << ")"; 1946 os << ")";
1947 } 1947 }
1954 pr_scale_header (os, scale); 1954 pr_scale_header (os, scale);
1955 1955
1956 // kluge. Get the true width of a number. 1956 // kluge. Get the true width of a number.
1957 int zero_fw; 1957 int zero_fw;
1958 1958
1959 { 1959 {
1960 std::ostringstream tmp_oss; 1960 std::ostringstream tmp_oss;
1961 pr_float (tmp_oss, 0.0, fw, scale); 1961 pr_float (tmp_oss, 0.0, fw, scale);
1962 zero_fw = tmp_oss.str ().length (); 1962 zero_fw = tmp_oss.str ().length ();
1963 } 1963 }
1964 1964
1965 for (octave_idx_type col = 0; col < nc; col += inc) 1965 for (octave_idx_type col = 0; col < nc; col += inc)
1966 { 1966 {
1967 octave_idx_type lim = col + inc < nc ? col + inc : nc; 1967 octave_idx_type lim = col + inc < nc ? col + inc : nc;
1968 1968
2131 bool pr_as_read_syntax, int extra_indent) 2131 bool pr_as_read_syntax, int extra_indent)
2132 { 2132 {
2133 octave_idx_type nr = cm.rows (); 2133 octave_idx_type nr = cm.rows ();
2134 octave_idx_type nc = cm.columns (); 2134 octave_idx_type nc = cm.columns ();
2135 2135
2136 if (nr == 0 || nc == 0) 2136 if (nr == 0 || nc == 0)
2137 print_empty_matrix (os, nr, nc, pr_as_read_syntax); 2137 print_empty_matrix (os, nr, nc, pr_as_read_syntax);
2138 else if (plus_format && ! pr_as_read_syntax) 2138 else if (plus_format && ! pr_as_read_syntax)
2139 { 2139 {
2140 for (octave_idx_type i = 0; i < nr; i++) 2140 for (octave_idx_type i = 0; i < nr; i++)
2141 { 2141 {
2267 bool pr_as_read_syntax, int extra_indent) 2267 bool pr_as_read_syntax, int extra_indent)
2268 { 2268 {
2269 octave_idx_type nr = cm.rows (); 2269 octave_idx_type nr = cm.rows ();
2270 octave_idx_type nc = cm.columns (); 2270 octave_idx_type nc = cm.columns ();
2271 2271
2272 if (nr == 0 || nc == 0) 2272 if (nr == 0 || nc == 0)
2273 print_empty_matrix (os, nr, nc, pr_as_read_syntax); 2273 print_empty_matrix (os, nr, nc, pr_as_read_syntax);
2274 else if (plus_format && ! pr_as_read_syntax) 2274 else if (plus_format && ! pr_as_read_syntax)
2275 { 2275 {
2276 for (octave_idx_type i = 0; i < nr; i++) 2276 for (octave_idx_type i = 0; i < nr; i++)
2277 { 2277 {
2353 } 2353 }
2354 2354
2355 col += inc; 2355 col += inc;
2356 2356
2357 if (col >= nc) 2357 if (col >= nc)
2358 os << " ]"; 2358 os << " ]";
2359 else 2359 else
2360 os << " ...\n"; 2360 os << " ...\n";
2361 } 2361 }
2362 os << ")"; 2362 os << ")";
2363 } 2363 }
2370 pr_scale_header (os, scale); 2370 pr_scale_header (os, scale);
2371 2371
2372 // kluge. Get the true width of a number. 2372 // kluge. Get the true width of a number.
2373 int zero_fw; 2373 int zero_fw;
2374 2374
2375 { 2375 {
2376 std::ostringstream tmp_oss; 2376 std::ostringstream tmp_oss;
2377 pr_complex (tmp_oss, Complex (0.0), r_fw, i_fw, scale); 2377 pr_complex (tmp_oss, Complex (0.0), r_fw, i_fw, scale);
2378 zero_fw = tmp_oss.str ().length (); 2378 zero_fw = tmp_oss.str ().length ();
2379 } 2379 }
2380 2380
2381 for (octave_idx_type col = 0; col < nc; col += inc) 2381 for (octave_idx_type col = 0; col < nc; col += inc)
2382 { 2382 {
2383 octave_idx_type lim = col + inc < nc ? col + inc : nc; 2383 octave_idx_type lim = col + inc < nc ? col + inc : nc;
2384 2384
2500 } 2500 }
2501 2501
2502 col += inc; 2502 col += inc;
2503 2503
2504 if (col >= nc) 2504 if (col >= nc)
2505 os << " ]"; 2505 os << " ]";
2506 else 2506 else
2507 os << " ...\n"; 2507 os << " ...\n";
2508 } 2508 }
2509 if (! colp) os << ", :"; 2509 if (! colp) os << ", :";
2510 os << ")"; 2510 os << ")";
2554 octave_print_internal (os, nda.matrix_value (), 2554 octave_print_internal (os, nda.matrix_value (),
2555 pr_as_read_syntax, extra_indent); 2555 pr_as_read_syntax, extra_indent);
2556 break; 2556 break;
2557 2557
2558 default: 2558 default:
2559 print_nd_array <ComplexNDArray, Complex, 2559 print_nd_array <ComplexNDArray, Complex, ComplexMatrix>
2560 ComplexMatrix> (os, nda, pr_as_read_syntax); 2560 (os, nda, pr_as_read_syntax);
2561 break; 2561 break;
2562 } 2562 }
2563 } 2563 }
2564 2564
2565 void 2565 void
2566 octave_print_internal (std::ostream& os, bool d, bool pr_as_read_syntax) 2566 octave_print_internal (std::ostream& os, bool d, bool pr_as_read_syntax)
2567 { 2567 {
2568 octave_print_internal (os, double (d), pr_as_read_syntax); 2568 octave_print_internal (os, double (d), pr_as_read_syntax);
2569 } 2569 }
2570 2570
2571 // FIXME -- write single precision versions of the printing functions. 2571 // FIXME: write single precision versions of the printing functions.
2572 2572
2573 void 2573 void
2574 octave_print_internal (std::ostream& os, float d, bool pr_as_read_syntax) 2574 octave_print_internal (std::ostream& os, float d, bool pr_as_read_syntax)
2575 { 2575 {
2576 octave_print_internal (os, double (d), pr_as_read_syntax); 2576 octave_print_internal (os, double (d), pr_as_read_syntax);
2606 2606
2607 void 2607 void
2608 octave_print_internal (std::ostream& os, const FloatComplexMatrix& cm, 2608 octave_print_internal (std::ostream& os, const FloatComplexMatrix& cm,
2609 bool pr_as_read_syntax, int extra_indent) 2609 bool pr_as_read_syntax, int extra_indent)
2610 { 2610 {
2611 octave_print_internal (os, ComplexMatrix (cm), pr_as_read_syntax, extra_indent); 2611 octave_print_internal (os, ComplexMatrix (cm), pr_as_read_syntax,
2612 extra_indent);
2612 } 2613 }
2613 2614
2614 void 2615 void
2615 octave_print_internal (std::ostream& os, const FloatComplexDiagMatrix& cm, 2616 octave_print_internal (std::ostream& os, const FloatComplexDiagMatrix& cm,
2616 bool pr_as_read_syntax, int extra_indent) 2617 bool pr_as_read_syntax, int extra_indent)
2617 { 2618 {
2618 octave_print_internal (os, ComplexDiagMatrix (cm), pr_as_read_syntax, extra_indent); 2619 octave_print_internal (os, ComplexDiagMatrix (cm), pr_as_read_syntax,
2620 extra_indent);
2619 } 2621 }
2620 2622
2621 void 2623 void
2622 octave_print_internal (std::ostream& os, const FloatComplexNDArray& nda, 2624 octave_print_internal (std::ostream& os, const FloatComplexNDArray& nda,
2623 bool pr_as_read_syntax, int extra_indent) 2625 bool pr_as_read_syntax, int extra_indent)
2624 { 2626 {
2625 octave_print_internal (os, ComplexNDArray (nda), pr_as_read_syntax, extra_indent); 2627 octave_print_internal (os, ComplexNDArray (nda), pr_as_read_syntax,
2628 extra_indent);
2626 } 2629 }
2627 2630
2628 void 2631 void
2629 octave_print_internal (std::ostream& os, const Range& r, 2632 octave_print_internal (std::ostream& os, const Range& r,
2630 bool pr_as_read_syntax, int extra_indent) 2633 bool pr_as_read_syntax, int extra_indent)
2826 octave_print_internal (os, nda.matrix_value (), 2829 octave_print_internal (os, nda.matrix_value (),
2827 pr_as_read_syntax, extra_indent, pr_as_string); 2830 pr_as_read_syntax, extra_indent, pr_as_string);
2828 break; 2831 break;
2829 2832
2830 default: 2833 default:
2831 print_nd_array <charNDArray, char, 2834 print_nd_array <charNDArray, char, charMatrix> (os, nda,
2832 charMatrix> (os, nda, pr_as_read_syntax); 2835 pr_as_read_syntax);
2833 break; 2836 break;
2834 } 2837 }
2835 } 2838 }
2836 2839
2837 void 2840 void
2845 2848
2846 void 2849 void
2847 octave_print_internal (std::ostream& os, const Array<std::string>& nda, 2850 octave_print_internal (std::ostream& os, const Array<std::string>& nda,
2848 bool pr_as_read_syntax, int /* extra_indent */) 2851 bool pr_as_read_syntax, int /* extra_indent */)
2849 { 2852 {
2850 // FIXME -- this mostly duplicates the code in the print_nd_array<> 2853 // FIXME: this mostly duplicates the code in the print_nd_array<>
2851 // function. Can fix this with std::is_same from C++11. 2854 // function. Can fix this with std::is_same from C++11.
2852 2855
2853 if (nda.is_empty ()) 2856 if (nda.is_empty ())
2854 print_empty_nd_array (os, nda.dims (), pr_as_read_syntax); 2857 print_empty_nd_array (os, nda.dims (), pr_as_read_syntax);
2855 else if (nda.length () == 1) 2858 else if (nda.length () == 1)
2903 for (int k = 2; k < ndims; k++) 2906 for (int k = 2; k < ndims; k++)
2904 idx(k) = idx_vector (ra_idx(k)); 2907 idx(k) = idx_vector (ra_idx(k));
2905 2908
2906 Array<std::string> page (nda.index (idx), dim_vector (nr, nc)); 2909 Array<std::string> page (nda.index (idx), dim_vector (nr, nc));
2907 2910
2908 // FIXME -- need to do some more work to put these 2911 // FIXME: need to do some more work to put these
2909 // in neatly aligned columns... 2912 // in neatly aligned columns...
2910 2913
2911 octave_idx_type n_rows = page.rows (); 2914 octave_idx_type n_rows = page.rows ();
2912 octave_idx_type n_cols = page.cols (); 2915 octave_idx_type n_cols = page.cols ();
2913 2916
2914 os << nm << " =\n"; 2917 os << nm << " =\n";
3017 if (bank_format) 3020 if (bank_format)
3018 os << ".00"; 3021 os << ".00";
3019 } 3022 }
3020 } 3023 }
3021 3024
3022 // FIXME -- all this mess with abs is an attempt to avoid seeing 3025 // FIXME: all this mess with abs is an attempt to avoid seeing
3023 // 3026 //
3024 // warning: comparison of unsigned expression < 0 is always false 3027 // warning: comparison of unsigned expression < 0 is always false
3025 // 3028 //
3026 // from GCC. Isn't there a better way 3029 // from GCC. Isn't there a better way?
3027 3030
3028 template <class T> 3031 template <class T>
3029 /* static */ inline T 3032 /* static */ inline T
3030 abs (T x) 3033 abs (T x)
3031 { 3034 {
3116 template <class T> 3119 template <class T>
3117 /* static */ inline void 3120 /* static */ inline void
3118 octave_print_internal_template (std::ostream& os, const intNDArray<T>& nda, 3121 octave_print_internal_template (std::ostream& os, const intNDArray<T>& nda,
3119 bool pr_as_read_syntax, int extra_indent) 3122 bool pr_as_read_syntax, int extra_indent)
3120 { 3123 {
3121 // FIXME -- this mostly duplicates the code in the print_nd_array<> 3124 // FIXME: this mostly duplicates the code in the print_nd_array<>
3122 // function. Can fix this with std::is_same from C++11. 3125 // function. Can fix this with std::is_same from C++11.
3123 3126
3124 if (nda.is_empty ()) 3127 if (nda.is_empty ())
3125 print_empty_nd_array (os, nda.dims (), pr_as_read_syntax); 3128 print_empty_nd_array (os, nda.dims (), pr_as_read_syntax);
3126 else if (nda.length () == 1) 3129 else if (nda.length () == 1)
3222 bool isneg = false; 3225 bool isneg = false;
3223 int digits = 0; 3226 int digits = 0;
3224 3227
3225 for (octave_idx_type i = 0; i < dims.numel (); i++) 3228 for (octave_idx_type i = 0; i < dims.numel (); i++)
3226 { 3229 {
3227 int new_digits = static_cast<int> 3230 int new_digits
3228 (gnulib::floor (log10 (double (abs (nda(i).value ()))) + 1.0)); 3231 = static_cast<int>
3232 (gnulib::floor (log10 (double (abs (nda(i).value ()))) + 1.0));
3229 3233
3230 if (new_digits > digits) 3234 if (new_digits > digits)
3231 digits = new_digits; 3235 digits = new_digits;
3232 3236
3233 if (! isneg) 3237 if (! isneg)
3234 isneg = (abs (nda(i).value ()) != nda(i).value ()); 3238 isneg = (abs (nda(i).value ()) != nda(i).value ());
3235 } 3239 }
3236 3240
3237 fw = digits + isneg; 3241 fw = digits + isneg;
3238 } 3242 }
3239 3243
3361 { 3365 {
3362 panic_impossible (); 3366 panic_impossible ();
3363 } 3367 }
3364 3368
3365 DEFUN (rats, args, nargout, 3369 DEFUN (rats, args, nargout,
3366 "-*- texinfo -*-\n\ 3370 "-*- texinfo -*-\n\
3367 @deftypefn {Built-in Function} {} rats (@var{x}, @var{len})\n\ 3371 @deftypefn {Built-in Function} {} rats (@var{x}, @var{len})\n\
3368 Convert @var{x} into a rational approximation represented as a string.\n\ 3372 Convert @var{x} into a rational approximation represented as a string.\n\
3369 You can convert the string back into a matrix as follows:\n\ 3373 You can convert the string back into a matrix as follows:\n\
3370 \n\ 3374 \n\
3371 @example\n\ 3375 @example\n\
3441 3445
3442 return retval; 3446 return retval;
3443 } 3447 }
3444 3448
3445 DEFUN (disp, args, nargout, 3449 DEFUN (disp, args, nargout,
3446 "-*- texinfo -*-\n\ 3450 "-*- texinfo -*-\n\
3447 @deftypefn {Built-in Function} {} disp (@var{x})\n\ 3451 @deftypefn {Built-in Function} {} disp (@var{x})\n\
3448 Display the value of @var{x}. For example:\n\ 3452 Display the value of @var{x}. For example:\n\
3449 \n\ 3453 \n\
3450 @example\n\ 3454 @example\n\
3451 @group\n\ 3455 @group\n\
3485 3489
3486 return retval; 3490 return retval;
3487 } 3491 }
3488 3492
3489 DEFUN (fdisp, args, , 3493 DEFUN (fdisp, args, ,
3490 "-*- texinfo -*-\n\ 3494 "-*- texinfo -*-\n\
3491 @deftypefn {Built-in Function} {} fdisp (@var{fid}, @var{x})\n\ 3495 @deftypefn {Built-in Function} {} fdisp (@var{fid}, @var{x})\n\
3492 Display the value of @var{x} on the stream @var{fid}. For example:\n\ 3496 Display the value of @var{x} on the stream @var{fid}. For example:\n\
3493 \n\ 3497 \n\
3494 @example\n\ 3498 @example\n\
3495 @group\n\ 3499 @group\n\
3757 set_output_prec_and_fw (5, 10); 3761 set_output_prec_and_fw (5, 10);
3758 } 3762 }
3759 } 3763 }
3760 3764
3761 DEFUN (format, args, , 3765 DEFUN (format, args, ,
3762 "-*- texinfo -*-\n\ 3766 "-*- texinfo -*-\n\
3763 @deftypefn {Command} {} format\n\ 3767 @deftypefn {Command} {} format\n\
3764 @deftypefnx {Command} {} format options\n\ 3768 @deftypefnx {Command} {} format options\n\
3765 Reset or specify the format of the output produced by @code{disp} and\n\ 3769 Reset or specify the format of the output produced by @code{disp} and\n\
3766 Octave's normal echoing mechanism. This command only affects the display\n\ 3770 Octave's normal echoing mechanism. This command only affects the display\n\
3767 of numbers but not how they are stored or computed. To change the internal\n\ 3771 of numbers but not how they are stored or computed. To change the internal\n\
3941 3945
3942 return retval; 3946 return retval;
3943 } 3947 }
3944 3948
3945 DEFUN (fixed_point_format, args, nargout, 3949 DEFUN (fixed_point_format, args, nargout,
3946 "-*- texinfo -*-\n\ 3950 "-*- texinfo -*-\n\
3947 @deftypefn {Built-in Function} {@var{val} =} fixed_point_format ()\n\ 3951 @deftypefn {Built-in Function} {@var{val} =} fixed_point_format ()\n\
3948 @deftypefnx {Built-in Function} {@var{old_val} =} fixed_point_format (@var{new_val})\n\ 3952 @deftypefnx {Built-in Function} {@var{old_val} =} fixed_point_format (@var{new_val})\n\
3949 @deftypefnx {Built-in Function} {} fixed_point_format (@var{new_val}, \"local\")\n\ 3953 @deftypefnx {Built-in Function} {} fixed_point_format (@var{new_val}, \"local\")\n\
3950 Query or set the internal variable that controls whether Octave will\n\ 3954 Query or set the internal variable that controls whether Octave will\n\
3951 use a scaled format to print matrix values such that the largest\n\ 3955 use a scaled format to print matrix values such that the largest\n\
3980 { 3984 {
3981 return SET_INTERNAL_VARIABLE (fixed_point_format); 3985 return SET_INTERNAL_VARIABLE (fixed_point_format);
3982 } 3986 }
3983 3987
3984 DEFUN (print_empty_dimensions, args, nargout, 3988 DEFUN (print_empty_dimensions, args, nargout,
3985 "-*- texinfo -*-\n\ 3989 "-*- texinfo -*-\n\
3986 @deftypefn {Built-in Function} {@var{val} =} print_empty_dimensions ()\n\ 3990 @deftypefn {Built-in Function} {@var{val} =} print_empty_dimensions ()\n\
3987 @deftypefnx {Built-in Function} {@var{old_val} =} print_empty_dimensions (@var{new_val})\n\ 3991 @deftypefnx {Built-in Function} {@var{old_val} =} print_empty_dimensions (@var{new_val})\n\
3988 @deftypefnx {Built-in Function} {} print_empty_dimensions (@var{new_val}, \"local\")\n\ 3992 @deftypefnx {Built-in Function} {} print_empty_dimensions (@var{new_val}, \"local\")\n\
3989 Query or set the internal variable that controls whether the\n\ 3993 Query or set the internal variable that controls whether the\n\
3990 dimensions of empty matrices are printed along with the empty matrix\n\ 3994 dimensions of empty matrices are printed along with the empty matrix\n\
4009 { 4013 {
4010 return SET_INTERNAL_VARIABLE (print_empty_dimensions); 4014 return SET_INTERNAL_VARIABLE (print_empty_dimensions);
4011 } 4015 }
4012 4016
4013 DEFUN (split_long_rows, args, nargout, 4017 DEFUN (split_long_rows, args, nargout,
4014 "-*- texinfo -*-\n\ 4018 "-*- texinfo -*-\n\
4015 @deftypefn {Built-in Function} {@var{val} =} split_long_rows ()\n\ 4019 @deftypefn {Built-in Function} {@var{val} =} split_long_rows ()\n\
4016 @deftypefnx {Built-in Function} {@var{old_val} =} split_long_rows (@var{new_val})\n\ 4020 @deftypefnx {Built-in Function} {@var{old_val} =} split_long_rows (@var{new_val})\n\
4017 @deftypefnx {Built-in Function} {} split_long_rows (@var{new_val}, \"local\")\n\ 4021 @deftypefnx {Built-in Function} {} split_long_rows (@var{new_val}, \"local\")\n\
4018 Query or set the internal variable that controls whether rows of a matrix\n\ 4022 Query or set the internal variable that controls whether rows of a matrix\n\
4019 may be split when displayed to a terminal window. If the rows are split,\n\ 4023 may be split when displayed to a terminal window. If the rows are split,\n\
4047 { 4051 {
4048 return SET_INTERNAL_VARIABLE (split_long_rows); 4052 return SET_INTERNAL_VARIABLE (split_long_rows);
4049 } 4053 }
4050 4054
4051 DEFUN (output_max_field_width, args, nargout, 4055 DEFUN (output_max_field_width, args, nargout,
4052 "-*- texinfo -*-\n\ 4056 "-*- texinfo -*-\n\
4053 @deftypefn {Built-in Function} {@var{val} =} output_max_field_width ()\n\ 4057 @deftypefn {Built-in Function} {@var{val} =} output_max_field_width ()\n\
4054 @deftypefnx {Built-in Function} {@var{old_val} =} output_max_field_width (@var{new_val})\n\ 4058 @deftypefnx {Built-in Function} {@var{old_val} =} output_max_field_width (@var{new_val})\n\
4055 @deftypefnx {Built-in Function} {} output_max_field_width (@var{new_val}, \"local\")\n\ 4059 @deftypefnx {Built-in Function} {} output_max_field_width (@var{new_val}, \"local\")\n\
4056 Query or set the internal variable that specifies the maximum width\n\ 4060 Query or set the internal variable that specifies the maximum width\n\
4057 of a numeric output field.\n\ 4061 of a numeric output field.\n\
4065 return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_max_field_width, 0, 4069 return SET_INTERNAL_VARIABLE_WITH_LIMITS (output_max_field_width, 0,
4066 std::numeric_limits<int>::max ()); 4070 std::numeric_limits<int>::max ());
4067 } 4071 }
4068 4072
4069 DEFUN (output_precision, args, nargout, 4073 DEFUN (output_precision, args, nargout,
4070 "-*- texinfo -*-\n\ 4074 "-*- texinfo -*-\n\
4071 @deftypefn {Built-in Function} {@var{val} =} output_precision ()\n\ 4075 @deftypefn {Built-in Function} {@var{val} =} output_precision ()\n\
4072 @deftypefnx {Built-in Function} {@var{old_val} =} output_precision (@var{new_val})\n\ 4076 @deftypefnx {Built-in Function} {@var{old_val} =} output_precision (@var{new_val})\n\
4073 @deftypefnx {Built-in Function} {} output_precision (@var{new_val}, \"local\")\n\ 4077 @deftypefnx {Built-in Function} {} output_precision (@var{new_val}, \"local\")\n\
4074 Query or set the internal variable that specifies the minimum number of\n\ 4078 Query or set the internal variable that specifies the minimum number of\n\
4075 significant figures to display for numeric output.\n\ 4079 significant figures to display for numeric output.\n\