Mercurial > octave-nkf
changeset 20491:7e9c752138ec stable
Fix 'descending' sort of Range objects (bug #45739).
* Range.cc (sort_internal): When doing a descending sort, start at the max()
value in the Range, rather than the rng_limit which may not be a part of the
range itself.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 20 Aug 2015 06:42:15 -0700 |
parents | d43675752d04 |
children | 642ce72cf1ab ba032e57fd96 |
files | liboctave/array/Range.cc |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/array/Range.cc Sun Aug 16 16:38:13 2015 +0200 +++ b/liboctave/array/Range.cc Thu Aug 20 06:42:15 2015 -0700 @@ -244,7 +244,7 @@ } else if (! ascending && rng_base < rng_limit && rng_inc > 0.0) { - double tmp = rng_limit; + double tmp = max (); rng_limit = min (); rng_base = tmp; rng_inc = -rng_inc; @@ -274,7 +274,7 @@ } else if (! ascending && rng_base < rng_limit && rng_inc > 0.0) { - double tmp = rng_limit; + double tmp = max (); rng_limit = min (); rng_base = tmp; rng_inc = -rng_inc;