changeset 32294:7e8a3299b866

rats - Update default string length from 9 to 13 (bug #43717). * libinterp/corefcn/pr-output.cc (rats): Change default string length to 13, update docstring accordingly. * etc/NEWS.9.md: Note change to rats under matlab compatibility.
author Nicholas R. Jankowski <jankowski.nicholas@gmail.com>
date Tue, 12 Sep 2023 15:29:51 -0400
parents 8738713f0f90
children e35c7b5356b7
files etc/NEWS.9.md libinterp/corefcn/pr-output.cc
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS.9.md	Tue Sep 12 13:17:54 2023 -0400
+++ b/etc/NEWS.9.md	Tue Sep 12 15:29:51 2023 -0400
@@ -137,6 +137,8 @@
 logical inputs and specified operating dimensions larger than the number
 of dimensions in the input array.
 
+- The default string length for the function `rats` has changed from 9 to 13.
+
 ### Alphabetical list of new functions added in Octave 9
 
 * `isenv`
--- a/libinterp/corefcn/pr-output.cc	Tue Sep 12 13:17:54 2023 -0400
+++ b/libinterp/corefcn/pr-output.cc	Tue Sep 12 15:29:51 2023 -0400
@@ -3207,7 +3207,7 @@
 @code{@var{x} = @var{N}/@var{D}}.
 
 The optional second argument defines the maximum length of the string
-representing the elements of @var{x}.  By default, @var{len} is 9.
+representing the elements of @var{x}.  By default, @var{len} is 13.
 
 If the length of the smallest possible rational approximation exceeds
 @var{len}, an asterisk (*) padded with spaces will be returned instead.
@@ -3248,7 +3248,7 @@
 
   frame.protect_var (rat_string_len);
 
-  rat_string_len = 9;
+  rat_string_len = 13;
   if (nargin == 2)
     rat_string_len = args(1).nint_value ();