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