mathematica newbie trouble
- To: mathgroup at smc.vnet.net
- Subject: [mg99276] mathematica newbie trouble
- From: Guapo <yangshuai at gmail.com>
- Date: Fri, 1 May 2009 05:52:31 -0400 (EDT)
i wrote the following mathematica code: s := (a + b + c)/2; k[a_, b_, c_] := Sqrt[s (s - a) (s - b) (s - c)]; k[3, 4, 5] k[5, 9, 12] when run it, i can't get the write answer. but i change setDelayed(:=) to set(=), everything works ok s = (a + b + c)/2; k[a_, b_, c_] = Sqrt[s (s - a) (s - b) (s - c)]; k[3, 4, 5] k[5, 9, 12] i did a google search for the difference of set and setDelayed, however, i still can't understand it for the upper described problem, could anyone explain it? great thanks.