MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: What is going on!?!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104733] Re: What is going on!?!
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Sun, 8 Nov 2009 06:46:44 -0500 (EST)
  • References: <hd3ml1$9in$1@smc.vnet.net>

Joe Hays wrote:
> Can anyone tell me why the output is not a simple "10" instead of "10 Null"?
> 
> In[3]:= x = 0;
> For[i = 1, i <= 10, i++,
>   x = x + 1;
>   ] x
> 
> Out[4]= 10 Null
> 
> 
Your For function returns Null, and this is getting multiplied by x 
because you forgot the semicolon after the ] .

David Bailey
http://www.dbaileyconsultancy.co.uk


  • Prev by Date: Re: What is going on!?!
  • Next by Date: Re: Complex solutions to simple equations
  • Previous by thread: Re: What is going on!?!
  • Next by thread: Re: What is going on!?!