Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Replace in Modules

  • To: mathgroup at
  • Subject: [mg81187] Replace in Modules
  • From: Joerg Schaber <schaber at>
  • Date: Sat, 15 Sep 2007 04:07:08 -0400 (EDT)


why doesn't the following give me the square root?

f[x_] := Module[{a, y},y = x;Return[FindRoot[y == a^2, {a, 1}]]]

f[z] /. {z -> 2}

where as

f[x_] := Module[{a},Return[FindRoot[x == a^2, {a, 1}]]]

f[z] /. {z -> 2}

works fine?



  • Prev by Date: Re: rationalize numerator of quotient
  • Next by Date: Exporting 3D vector graphics
  • Previous by thread: Re: Previous version features for 2-D and 3-D plots
  • Next by thread: Re: Replace in Modules