Re: Don't change my definition of a function
- To: mathgroup at smc.vnet.net
- Subject: [mg20746] Re: Don't change my definition of a function
- From: Harald Giese <giese at dkrz.de>
- Date: Wed, 10 Nov 1999 00:17:54 -0500
- Organization: Institut fuer Meereskunde, Universitaet Hamburg
- References: <803acp$aod@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
"Toshiyuki (Toshi) Meshii" wrote: > > Hi, > > I think Mathematica 4 (Win98) is changing the definition of a function every time I > execute some procedures. > Can somebody let me know what is happening? > > Here it is. > > I defined FM[x] as > FM[x_]=1.122- 1.4 x + 7.33 x^2 - 13.08 x^3 + 14. x^4 > Hi Toshi, The reason for that behavoiur is, because you have used "=" instead of ":=" . The Mathematica online-help says: Set (=) lhs = rhs evaluates rhs and assigns the result to be the value of lhs. SetDelayed (:=) lhs := rhs assigns rhs to be the delayed value of lhs. rhs is maintained in an unevaluated form. When lhs appears, it is replaced by rhs, evaluated afresh each time. Regards, /Harald -- Harald Giese Email: giese at dkrz.de > NEUE TELEFON-NUMMER | NEW PHONE-NUMBER < Phone: +49 (0)40 42838 5796; Fax: +49 (0)40 5605724 Institut fuer Meereskunde der Universitaet Hamburg (Institute of Oceanography of the University of Hamburg) Troplowitzstrasse 7, D-22529 Hamburg