Mercurial > hg > octave-nkf
changeset 19475:e1713e281ac5
rat.m: Remove unnecessary blank line at start of output (bug #43374).
* rat.m: Check whether numerator is null before expanding it to the
length of s. Add BIST test for correct behavior.
author | Markus Bergholz <markuman+octave@gmail.com> |
---|---|
date | Tue, 07 Oct 2014 21:11:17 +0200 |
parents | a834b3151c7e |
children | 86f50893acd8 |
files | scripts/general/rat.m |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/general/rat.m +++ b/scripts/general/rat.m @@ -142,7 +142,7 @@ s_nc = columns (s); if (n_nc > s_nc) s(:,s_nc+1:n_nc) = " "; - elseif (s_nc > n_nc) + elseif (s_nc > n_nc && n_nc != 0) n(:,n_nc+1:s_nc) = " "; endif n = cat (1, n, s); @@ -157,6 +157,9 @@ %! assert (n, [1, 3, 1]); %! assert (d, [2, 10, 3]); +## bug #43374 +%!assert (eval (rat (0.75)), [0.75]) + %!error rat (); %!error rat (1, 2, 3);