MathGroup Archive 2007

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

Search the Archive

Fuction definition


Hi

When I try :
------------------
p = 1;
f1[x_] := p Sin[Pi x];
p = 2;
f2[x_] := p Sin[Pi x];

f1[0.5]
f2[0.5]

Out[26]=2.

Out[27]=2.
-----------------
When I use = instead of := it works OK.
Why ?

It is safely to use "=" in function definition ?

I have to integrate and differentiate such function in the future.
In my case function depends on about 20 parameters, which are calculated
three times, (I want to obtain three functions)

I'm not sure is this good idea to use '=' ?

Regards , Olaf




  • Prev by Date: Custom sort a list of pairs
  • Next by Date: ReplaceList and //.
  • Previous by thread: Re: Custom sort a list of pairs
  • Next by thread: Re: Fuction definition