Re: Sometimes <space> means multiple , sometimes not

*To*: mathgroup at smc.vnet.net*Subject*: [mg75361] Re: Sometimes <space> means multiple , sometimes not*From*: David Bailey <dave at Remove_Thisdbailey.co.uk>*Date*: Thu, 26 Apr 2007 03:36:28 -0400 (EDT)*References*: <f0n6su$p9d$1@smc.vnet.net>

siewsk at bp.com wrote: > As a newbie, I was taught that <space> character in Mathematica means > multiple. But sometimes it does not. > > For example: > > 4<space>2 gives 8 > > but > > -4<space>-2 does not give -8 > > This strange behavior can be show below > > In[1]:= 4 2 (* 4<space>2 *) > Out[1]= 8 > > In[2]:= 4 +2 (* 4<space>+2 *) > Out[2]= 6 > > In[3]:= +4 2 (* +4<space>2 *) > Out[3]= 8 > > In[4]:= +4 +2 (* +4<space>+2 *) > Out[4]= 6 > > In[5]:= +4 -2 (* +4<space>-2 *) > Out[5]= 2 > > In[6]:= 4 -2 (* 4<space>-2 *) > Out[6]= 2 > > In[7]:= -4 -2 (* -4<space>-2 *) > Out[7]= -6 > > In[8]:= -4 2 (* -4<space>2 *) > Out[8]= -8 > > The space rules are obviously meant to mimic ordinary algebra syntax rules. Although it is not common to write 2<space>4 in algebra, x y means x times y whereas x-y (with or without embedded spaces) means what it says. Unlike conventional algebra, Mathematica has to cater for multi-character variables, so xy has a different meaning from x<space>y. David Bailey http://www.dbaileyconsultancy.co.uk