changeset 9576:d73c9bd101ef

fix int2str
author Jaroslav Hajek <highegg@gmail.com>
date Thu, 27 Aug 2009 07:54:44 +0200
parents 55ecaefb7d0f
children b03062e16c6f
files scripts/ChangeLog scripts/general/int2str.m
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Tue Aug 25 14:03:30 2009 +0200
+++ b/scripts/ChangeLog	Thu Aug 27 07:54:44 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-26  E. Joshua Rigler  <relgire@gmail.com>
 
 	* time/datestr.m: Set tm.isdst to -1 before calling mktime.
--- a/scripts/general/int2str.m	Tue Aug 25 14:03:30 2009 +0200
+++ b/scripts/general/int2str.m	Thu Aug 27 07:54:44 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++;