Mercurial > octave
changeset 27156:d0c32d60ed35
maint: merge stable to default.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 06 Jun 2019 14:16:40 -0700 |
parents | 09eedaac54cb (current diff) 53ae2b0fee3c (diff) |
children | e2061085dc5e |
files | libinterp/corefcn/gl2ps-print.cc libinterp/corefcn/pr-output.cc |
diffstat | 2 files changed, 15 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/gl2ps-print.cc Wed Jun 05 20:43:55 2019 -0700 +++ b/libinterp/corefcn/gl2ps-print.cc Thu Jun 06 14:16:40 2019 -0700 @@ -962,6 +962,7 @@ } } + escape_character ("\\", str); escape_character ("(", str); escape_character (")", str);
--- a/libinterp/corefcn/pr-output.cc Wed Jun 05 20:43:55 2019 -0700 +++ b/libinterp/corefcn/pr-output.cc Thu Jun 06 14:16:40 2019 -0700 @@ -3092,10 +3092,21 @@ DEFUN (rats, args, , doc: /* -*- texinfo -*- -@deftypefn {} {} rats (@var{x}, @var{len}) +@deftypefn {} {@var{s} =} rats (@var{x}) +@deftypefnx {} {@var{s} =} rats (@var{x}, @var{len}) Convert @var{x} into a rational approximation represented as a string. -The string can be converted back into a matrix as follows: +A rational approximation to a floating point number is a simple fraction +with numerator @var{N} and denominator @var{D} such that +@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. + +If the length of the smallest possible rational approximation exceeds +@var{len}, an asterisk (*) padded with spaces will be returned instead. + +Example conversion from matrix to string, and back again. @example @group @@ -3104,12 +3115,7 @@ @end group @end example -The optional second argument defines the maximum length of the string -representing the elements of @var{x}. By default @var{len} is 9. - -If the length of the smallest possible rational approximation exceeds -@var{len}, an asterisk (*) padded with spaces will be returned instead. -@seealso{format, rat} +@seealso{rat, format} @end deftypefn */) { int nargin = args.length ();