Mercurial > hg > octave-nkf
diff liboctave/Range.cc @ 2383:096529066838
[project @ 1996-10-12 17:50:47 by jwe]
author | jwe |
---|---|
date | Sat, 12 Oct 1996 17:52:55 +0000 |
parents | 1b57120c997b |
children | 9705ea40f0a2 |
line wrap: on
line diff
--- a/liboctave/Range.cc +++ b/liboctave/Range.cc @@ -36,6 +36,19 @@ #include "Range.h" #include "dMatrix.h" +#include "lo-mappers.h" +#include "lo-utils.h" + +bool +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. + + return (! (xisnan (rng_base) || xisnan (rng_inc)) + && (double) NINT (rng_base) == rng_base + && (double) NINT (rng_inc) == rng_inc); +} Matrix Range::matrix_value (void) const