[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about Range class
From: |
John W. Eaton |
Subject: |
Re: Question about Range class |
Date: |
Thu, 24 Nov 2005 09:36:28 -0500 |
On 24-Nov-2005, Shai Ayal wrote:
| Robert A. Macy wrote:
| > Pedro,
| >
| > In octave, two arguments...
| > z = (1:100)/10
| >
| > or, three arguments...
| > Z = (1:0.1:10)
| > ...give identical z arrays, but the increment is STILL
| > placed between the start and finish. Going from two
| > arguments to three, one inserts the increment between.
|
| True, but you can't do that very easily in c++.
Why not? True, you can't use the base:increment:limit syntax (with
the colon operator) but you could define Range constuctors that
approximate it. The two argument Range constructor could accept base
and limit arguments and set increment to 1. The three argument version
could accept base, increment, and limit arguments (in that order).
But it happens that I did not make that choice way back when.
As I said, I was probably influenced by Fortran's
do 10 base, limit [, increment]
...
10 continue
syntax.
In any case, there's little chance of going back now.
jwe
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Question about Range class, Marek Szczypinski, 2005/11/22
- Re: Question about Range class, Robert A. Macy, 2005/11/22
- Re: Question about Range class, John W. Eaton, 2005/11/22
- Re: Question about Range class, Pedro Antonio Fructuoso Merino, 2005/11/23
- Re: Question about Range class, Robert A. Macy, 2005/11/23
- Re: Question about Range class, Shai Ayal, 2005/11/24
- Re: Question about Range class,
John W. Eaton <=
- Re: Question about Range class, Joe Koski, 2005/11/24
- Re: Question about Range class, Miroslaw Kwasniak, 2005/11/25
- Re: Question about Range class, Robert A. Macy, 2005/11/25
- Re: Question about Range class, Przemek Klosowski, 2005/11/25
- Re: Question about Range class, Robert A. Macy, 2005/11/25
- Re: Question about Range class, Henry F. Mollet, 2005/11/25
- Re: Question about Range class, Robert A. Macy, 2005/11/25