changeset 12080:16a1e60b4701 release-3-2-x

fix int2str
author Jaroslav Hajek <highegg@gmail.com>
date Tue, 01 Sep 2009 09:32:38 +0200
parents 295001bff26d
children c781fb52c1d7
files scripts/ChangeLog scripts/general/int2str.m
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Tue Sep 01 09:31:39 2009 +0200
+++ b/scripts/ChangeLog	Tue Sep 01 09:32:38 2009 +0200
@@ -1,3 +1,7 @@
+2009-08-17  Jaroslav Hajek  <highegg@gmail.com>
+
+	* general/int2str.m: Convert to double before calling log10.
+
 2009-08-29  John W. Eaton  <jwe@octave.org>
 
 	* time/datestr.m: Add missing semicolon.
--- a/scripts/general/int2str.m	Tue Sep 01 09:31:39 2009 +0200
+++ b/scripts/general/int2str.m	Tue Sep 01 09:32:38 2009 +0200
@@ -102,7 +102,7 @@
       fmt = sprintf ("%%%dd", min_fw);
     else
       ## Could have anything.
-      tfw = floor (log10 (abs (t))) + 1 + sep;
+      tfw = floor (log10 (double (abs (t)))) + 1 + sep;
       fw = max (tfw);
       if (any (t(tfw == fw) < 0))
 	fw++;