MathGroup Archive 2007

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

Search the Archive

Replace in Modules


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