Mercurial > hg > octave-nkf
diff liboctave/Range.cc @ 1360:7eb93d12654c
[project @ 1995-09-05 21:51:54 by jwe]
author | jwe |
---|---|
date | Tue, 05 Sep 1995 21:51:54 +0000 |
parents | 611d403c7f3d |
children | 9f9131a8d706 |
line wrap: on
line diff
--- a/liboctave/Range.cc +++ b/liboctave/Range.cc @@ -135,9 +135,6 @@ return is; } -int -Range::nelem_internal (void) const -{ // Find an approximate number of intervals, then do the best we can to // find the number of intervals that we would get if we had done // something like @@ -151,7 +148,10 @@ // The number of elements in the range is one greater than the number // of intervals. -// We can't have more than INT_MAX elements in the range. +int +Range::nelem_internal (void) const +{ + // We can't have more than INT_MAX elements in the range. double d_n_intervals = (rng_limit - rng_base) / rng_inc; int max_intervals = INT_MAX - 1; @@ -166,13 +166,13 @@ if (rng_limit > rng_base && rng_inc > 0) { -// Our approximation may have been too big. + // Our approximation may have been too big. while (rng_base + n_intervals * rng_inc > rng_limit && n_intervals > 0) n_intervals--; -// Now that we are close, get the actual number. Try to avoid -// problems with extended precision registers. + // Now that we are close, get the actual number. Try to avoid + // problems with extended precision registers. for (;;) { @@ -186,13 +186,13 @@ } else if (rng_limit < rng_base && rng_inc < 0) { -// Our approximation may have been too big. + // Our approximation may have been too big. while (rng_base + n_intervals * rng_inc < rng_limit && n_intervals > 0) n_intervals--; -// Now that we are close, get the actual number. Try to avoid -// problems with extended precision registers. + // Now that we are close, get the actual number. Try to avoid + // problems with extended precision registers. for (;;) {