Mercurial > hg > octave-terminal
changeset 10775:6892c5562950
fix bug in accumarray
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Thu, 08 Jul 2010 13:51:37 +0200 |
parents | cfb13443434f |
children | 062304bd692e |
files | scripts/ChangeLog scripts/general/accumarray.m |
diffstat | 2 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2010-07-08 Jaroslav Hajek <highegg@gmail.com> + + * general/accumarray.m: Fix incorrect handling of nondefault fill + values in min/max reductions of integers. + 2010-07-07 David Bateman <dbateman@free.fr> * __next_line_color__.m: Allow conditional initialisation of the
--- a/scripts/general/accumarray.m +++ b/scripts/general/accumarray.m @@ -205,7 +205,7 @@ A = reshape (A, sz); endif - if (fillval != zero && isnan (fillval) != isnan (zero)) + if (fillval != zero && ! (isnan (fillval) || isnan (zero))) mask = true (size (A)); mask(subs) = false; A(mask) = fillval; @@ -228,7 +228,7 @@ A = reshape (A, sz); endif - if (fillval != zero && isnan (fillval) != isnan (zero)) + if (fillval != zero && ! (isnan (fillval) || isnan (zero))) mask = true (size (A)); mask(subs) = false; A(mask) = fillval;