Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*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 2005

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

Search the Archive

Re: FixedPoint

  • To: mathgroup at smc.vnet.net
  • Subject: [mg62232] Re: [mg62227] FixedPoint
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Wed, 16 Nov 2005 04:21:53 -0500 (EST)
  • References: <200511160728.CAA08507@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 16 Nov 2005, at 16:28, Scott wrote:

> Anybody know how to get FixedPoint to reveal how many iterations it  
> had
> to perform before it found the fixed point; i.e. what n was when SameQ
> was satisfied and FixedPoint exited.
>
> Thanks for any insight.
>
> Cheers, Scott
>

Just add your own own iterator, e.g. like this:


Block[{n = 0}, {FixedPoint[(n++; (1/2)*(#1 + 2/#1)) & ,
     1.], n}]


{1.414213562373095, 6}

Andrzej Kozlowski


  • References:
  • Prev by Date: Re: Re: FullSimplify Hang?
  • Next by Date: Re: Re: aggregation of related elements in a list
  • Previous by thread: FixedPoint
  • Next by thread: Re: FixedPoint