Mercurial > octave-nkf
comparison 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 |
comparison
equal
deleted
inserted
replaced
19250:4b6f87c6739f | 19253:3978a5509f40 |
---|---|
334 if (rhs.is_range ()) | 334 if (rhs.is_range ()) |
335 { | 335 { |
336 Range rng = rhs.range_value (); | 336 Range rng = rhs.range_value (); |
337 | 337 |
338 octave_idx_type steps = rng.nelem (); | 338 octave_idx_type steps = rng.nelem (); |
339 double b = rng.base (); | |
340 double increment = rng.inc (); | |
341 | 339 |
342 for (octave_idx_type i = 0; i < steps; i++) | 340 for (octave_idx_type i = 0; i < steps; i++) |
343 { | 341 { |
344 // Use multiplication here rather than declaring a | 342 octave_value val (rng.elem (i)); |
345 // temporary variable outside the loop and using | |
346 // | |
347 // tmp_val += increment | |
348 // | |
349 // to avoid problems with limited precision. Also, this | |
350 // is consistent with the way Range::matrix_value is | |
351 // implemented. | |
352 | |
353 octave_value val (b + i * increment); | |
354 | 343 |
355 ult.assign (octave_value::op_asn_eq, val); | 344 ult.assign (octave_value::op_asn_eq, val); |
356 | 345 |
357 if (! error_state && loop_body) | 346 if (! error_state && loop_body) |
358 loop_body->accept (*this); | 347 loop_body->accept (*this); |