Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Mathematica bugs?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67312] Re: Mathematica bugs?
  • From: john2 <john2 at 8889.fsnet.co.uk>
  • Date: Sun, 18 Jun 2006 05:12:55 -0400 (EDT)
  • References: <e70f29$rf4$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Yaroslav Bulatov wrote:
> When I run the following line
> x = Pi/4; For[i = 0, i < 56, i += 1, x = 2*Abs[x - 1/2]]; N[x]
> I get
> 3.
> 
> But x should always stay between 0 and 1, why do I get 3?

Try this:
For[i=0,i<56,i+=1,x=2*Abs[x-1/2];Print[N[x]]]
and the problem is fairly obvious

john2


  • Prev by Date: Menu/Kernel/Evaluation/Evaluate Notebook
  • Next by Date: using a previous result
  • Previous by thread: Re: Mathematica bugs?
  • Next by thread: Re: Mathematica bugs?