Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*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 smc.vnet.net
  • Subject: [mg81187] Replace in Modules
  • From: Joerg Schaber <schaber at molgen.mpg.de>
  • Date: Sat, 15 Sep 2007 04:07:08 -0400 (EDT)

Hi,

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?

best,

joerg


  • 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