Mercurial > hg > octave-avbm
changeset 9844:edf065b51fa9
fix dec2base
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 20 Nov 2009 10:35:49 +0100 |
parents | 71483d19204f |
children | 722bd8f6a750 |
files | scripts/ChangeLog scripts/strings/dec2base.m |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2009-11-20 Jaroslav Hajek <highegg@gmail.com> + + * scripts/strings/dec2base.m: Fix division. + 2009-11-20 Lukas Reichlin <lukas.reichlin@swissonline.ch> * linear-algebra/krylov.m: Add missing swap routine.
--- a/scripts/strings/dec2base.m +++ b/scripts/strings/dec2base.m @@ -86,7 +86,7 @@ ## determine digits for each number power = ones (length (n), 1) * (base .^ (max_len-1 : -1 : 0)); n = n(:) * ones (1, max_len); - digits = floor (rem (n, base*power) ./ power); + digits = floor (double (rem (n, base*power)) ./ power); ## convert digits to symbols retval = reshape (symbols (digits+1), size (digits));