diff liboctave/Range.cc @ 5275:23b37da9fd5b

[project @ 2005-04-08 16:07:35 by jwe]
author jwe
date Fri, 08 Apr 2005 16:07:37 +0000
parents e35b034d3523
children 4c8a2e4e0717
line wrap: on
line diff
--- a/liboctave/Range.cc	Thu Apr 07 21:51:37 2005 +0000
+++ b/liboctave/Range.cc	Fri Apr 08 16:07:37 2005 +0000
@@ -41,8 +41,8 @@
   // will also be an integer, even if the limit is not.
 
   return (! (xisnan (rng_base) || xisnan (rng_inc))
-	  && NINT (rng_base) == rng_base
-	  && NINT (rng_inc) == rng_inc);
+	  && NINTbig (rng_base) == rng_base
+	  && NINTbig (rng_inc) == rng_inc);
 }
 
 Matrix
@@ -53,7 +53,7 @@
       cache.resize (1, rng_nelem);
       double b = rng_base;
       double increment = rng_inc;
-      for (int i = 0; i < rng_nelem; i++)
+      for (octave_idx_type i = 0; i < rng_nelem; i++)
 	cache(i) = b + i * increment;
 
       // On some machines (x86 with extended precision floating point
@@ -134,9 +134,9 @@
 {
   double b = a.base ();
   double increment = a.inc ();
-  int num_elem = a.nelem ();
+  octave_idx_type num_elem = a.nelem ();
 
-  for (int i = 0; i < num_elem-1; i++)
+  for (octave_idx_type i = 0; i < num_elem-1; i++)
     os << b + i * increment << " ";
 
   // Prevent overshoot.  See comment in the matrix_value method
@@ -247,10 +247,10 @@
   return fabs (u - v) < ((tu > tv ? tu : tv) * ct);
 }
 
-int
+octave_idx_type
 Range::nelem_internal (void) const
 {
-  int retval = -1;
+  octave_idx_type retval = -1;
 
   if (rng_inc == 0
       || (rng_limit > rng_base && rng_inc < 0)
@@ -264,7 +264,7 @@
 
       double tmp = tfloor ((rng_limit - rng_base + rng_inc) / rng_inc, ct);
 
-      int n_elt = (tmp > 0.0 ? static_cast<int> (tmp) : 0);
+      octave_idx_type n_elt = (tmp > 0.0 ? static_cast<octave_idx_type> (tmp) : 0);
 
       // If the final element that we would compute for the range is
       // equal to the limit of the range, or is an adjacent floating