diff libinterp/parse-tree/pt-eval.cc @ 19253:3978a5509f40 gui-release

maint: Periodic merge of stable to gui-release.
author John W. Eaton <jwe@octave.org>
date Sun, 05 Oct 2014 10:46:48 -0400
parents bc139ccccef9 0279c601b49c
children 6443693a176f c1ce43276b86
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-eval.cc	Sun Oct 05 11:36:29 2014 +0200
+++ b/libinterp/parse-tree/pt-eval.cc	Sun Oct 05 10:46:48 2014 -0400
@@ -336,21 +336,10 @@
         Range rng = rhs.range_value ();
 
         octave_idx_type steps = rng.nelem ();
-        double b = rng.base ();
-        double increment = rng.inc ();
 
         for (octave_idx_type i = 0; i < steps; i++)
           {
-            // Use multiplication here rather than declaring a
-            // temporary variable outside the loop and using
-            //
-            //   tmp_val += increment
-            //
-            // to avoid problems with limited precision.  Also, this
-            // is consistent with the way Range::matrix_value is
-            // implemented.
-
-            octave_value val (b + i * increment);
+            octave_value val (rng.elem (i));
 
             ult.assign (octave_value::op_asn_eq, val);