changeset 17293:e351b499311e

Handle '+' format modifier in sprintf (bug #39773) * libinterp/corefcn/oct-stream.cc: Print '+' character even for Inf and NaN when '+' format specified. * scripts/general/num2str.m: Handle Inf values correctly when generating format for sprintf. Add new %!tests. * test/io.tst: Add %! tests for sprintf behavior. Use Octave coding conventions on rest of file.
author Rik <rik@octave.org>
date Tue, 20 Aug 2013 11:07:53 -0700
parents c5073ed27cdc
children 5ff843d739fc
files scripts/general/num2str.m
diffstat 1 files changed, 0 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/general/num2str.m	Tue Aug 20 11:06:20 2013 -0700
+++ b/scripts/general/num2str.m	Tue Aug 20 11:07:53 2013 -0700
@@ -129,8 +129,6 @@
       endif
     else
       ## Setup a suitable format string
-      #dgt = floor (log10 (max (max (abs (real (x(:)))),
-      #                         max (abs (imag (x(:)))))));
       dgt = floor (log10 (max (max (abs (real (x(!isinf (real (x(:))))))),
                                max (abs (imag (x(!isinf (imag (x(:))))))))));
       if (isempty (dgt))