Range[imin,imax,di]; was it better in 3.0 than in 4.0 ?
- To: mathgroup at smc.vnet.net
- Subject: [mg19570] Range[imin,imax,di]; was it better in 3.0 than in 4.0 ?
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Wed, 1 Sep 1999 23:07:04 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Range[imin,imax,di] had an interesting capability in version 3.0, but the
capability is gone in version 4.0.
--------------------------------
Using version 3.0:
In[1]:=
Range[a,a+12 n, 2n]
Out[1]=
{a,a+2 n,a+4 n,a+6 n,a+8 n,a+10 n,a+12 n}
-----------------------------------------------
I thought that was rather nice, but using version 4.0 we get:
In[1]:=
Range[a,a+12 n,2n]
Range::range: Range specification in Range[a,a+12 n,2 n] is not a
machine-size integer.
Out[1]=
Range[a,a+12 n,2 n]
Now contrary to what the message above suggests, Range doesn't need Integer
arguments. Both version 3 and version 4 give the same result in the
following example.
In[2]:=
Clear[x];
Range[x- Pi, x+ Pi, E]
Out[2]=
{-Pi + x, E - Pi + x, 2*E - Pi + x}
--------------------
Regards,
Ted Ersek
For Mathematica tips, tricks see
http://www.dot.net.au/~elisha/ersek/Tricks.html