Mercurial > hg > octave-nkf
diff liboctave/Range.cc @ 6457:a58b5981ab65
[project @ 2007-03-26 16:51:46 by jwe]
author | jwe |
---|---|
date | Mon, 26 Mar 2007 16:51:47 +0000 |
parents | 4c8a2e4e0717 |
children | 0ad7655cf2bc |
line wrap: on
line diff
--- a/liboctave/Range.cc +++ b/liboctave/Range.cc @@ -39,11 +39,12 @@ Range::all_elements_are_ints (void) const { // If the base and increment are ints, the final value in the range - // will also be an integer, even if the limit is not. + // will also be an integer, even if the limit is not. If there is one + // or fewer elements only the base needs to be an integer return (! (xisnan (rng_base) || xisnan (rng_inc)) - && NINTbig (rng_base) == rng_base - && NINTbig (rng_inc) == rng_inc); + && (NINTbig (rng_base) == rng_base || rng_nelem < 1) + && (NINTbig (rng_inc) == rng_inc || rng_nelem <= 1)); } Matrix