MathGroup Archive 2007

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

Search the Archive

Fuction definition

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73635] Fuction definition
  • From: bar at ANTYSPAM.ap.krakow.pl
  • Date: Fri, 23 Feb 2007 04:42:59 -0500 (EST)
  • Organization: Akademia Pedagogiczna w Krakowie

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