Re: Undiscovered Bug?

*To*: mathgroup at smc.vnet.net*Subject*: [mg46894] Re: Undiscovered Bug?*From*: Bill Rowe <readnewsciv at earthlink.net>*Date*: Fri, 12 Mar 2004 23:40:19 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

On 3/12/04 at 2:02 AM, Harold.Noffke at wpafb.af.mil (Harold Noffke) wrote: >In Mathematica 5.0.1 with Windows 2000, I mistakenly used the >[[{}]] operator on x/y. I was expecting an error, but I kept >getting unusual results as shown in In/Out's 2 to 5 below. >Have I stumbled on a bug, or is there a way to make sense out of >this? >In[1]:= TreeForm[x/y] >Out[1]//TreeForm= Times[x, | ] > Power[y, -1] >In[2]:= (x/y)[[{2,2}]] >Out[2]= -2 > y No, this is not a bug. Look at Section 2.1.4 of the Mathematica Book. In this particular example, you start with an expression with head Times. Then part grabs each subpart you speficfy and applies Times to them since it is the head of the expression you started with. In this case, you asked for 1/y twice. So, you got y^-2 as you should. -- To reply via email subtract one hundred and four