comparison 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
comparison
equal deleted inserted replaced
6456:7f5316cadaa2 6457:a58b5981ab65
37 37
38 bool 38 bool
39 Range::all_elements_are_ints (void) const 39 Range::all_elements_are_ints (void) const
40 { 40 {
41 // If the base and increment are ints, the final value in the range 41 // If the base and increment are ints, the final value in the range
42 // will also be an integer, even if the limit is not. 42 // will also be an integer, even if the limit is not. If there is one
43 // or fewer elements only the base needs to be an integer
43 44
44 return (! (xisnan (rng_base) || xisnan (rng_inc)) 45 return (! (xisnan (rng_base) || xisnan (rng_inc))
45 && NINTbig (rng_base) == rng_base 46 && (NINTbig (rng_base) == rng_base || rng_nelem < 1)
46 && NINTbig (rng_inc) == rng_inc); 47 && (NINTbig (rng_inc) == rng_inc || rng_nelem <= 1));
47 } 48 }
48 49
49 Matrix 50 Matrix
50 Range::matrix_value (void) const 51 Range::matrix_value (void) const
51 { 52 {