changeset 31008:4d74446020ad stable

doc: Document contracted format arguments (bug #62417). * libinterp/corefcn/pr-output.cc (Fformat): To avoid a misleading format of the help string, document the contracted arguments of format as the default. Continue to document the split strings as an option.
author Markus Mützel <markus.muetzel@gmx.de>
date Sun, 22 May 2022 19:34:03 +0200
parents 35d37e433532
children a0c8c28c38cb c2407c2749fb
files libinterp/corefcn/pr-output.cc
diffstat 1 files changed, 15 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/pr-output.cc	Sun Jan 30 16:41:44 2022 +0100
+++ b/libinterp/corefcn/pr-output.cc	Sun May 22 19:34:03 2022 +0200
@@ -3833,18 +3833,19 @@
 As with the @samp{short} format, Octave will switch to an exponential @samp{e}
 format if it is unable to format a matrix properly using the current format.
 
-@item  short e
-@itemx long e
+@item  shorte
+@itemx longe
 Exponential format.  The number to be represented is split between a mantissa
 and an exponent (power of 10).  The mantissa has 5 significant digits in the
 short format.  In the long format, double values are displayed with 16
 significant digits and single values are displayed with 8.  For example,
-with the @samp{short e} format, @code{pi} is displayed as @code{3.1416e+00}.
-
-@item  short g
-@itemx long g
+with the @samp{shorte} format, @code{pi} is displayed as @code{3.1416e+00}.
+Optionally, the trailing @samp{e} can be split into a second argument.
+
+@item  shortg
+@itemx longg
 Optimally choose between fixed point and exponential format based on the
-magnitude of the number.  For example, with the @samp{short g} format,
+magnitude of the number.  For example, with the @samp{shortg} format,
 @code{pi .^ [2; 4; 8; 16; 32]} is displayed as
 
 @example
@@ -3858,12 +3859,14 @@
   8.1058e+15
 @end group
 @end example
-
-@item  short eng
-@itemx long eng
-Identical to @samp{short e} or @samp{long e} but displays the value using an
+Optionally, the trailing @samp{g} can be split into a second argument.
+
+@item  shorteng
+@itemx longeng
+Identical to @samp{shorte} or @samp{longe} but displays the value using an
 engineering format, where the exponent is divisible by 3.  For example, with
-the @samp{short eng} format, @code{10 * pi} is displayed as @code{31.416e+00}.
+the @samp{shorteng} format, @code{10 * pi} is displayed as @code{31.416e+00}.
+Optionally, the trailing @samp{eng} can be split into a second argument.
 
 @item  free
 @itemx none