Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

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

Search the Archive

Questions on the finer points.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4496] Questions on the finer points.
  • From: Hein Hundal <hundal at vicon.net>
  • Date: Fri, 2 Aug 1996 02:22:27 -0400
  • Organization: Core Capital
  • Sender: owner-wri-mathgroup at wolfram.com

There are some things in Mathematica that seem to be the same, but I 
suspect that they are some different.  Could someone enlighten me about 
the difference between the following:

1)  What is the difference (if any) between f and g? Are there any 
circumstances where f will work, but g won't.  Is g always faster than 
f?  Does anyone prefer one definition to the other for another reason?

1a)

  f[x_] := x^2
  g     =  #^2 &

1b)
  f[x_] := 1 /; x > 0
  f[x_] := 0 /; x <= 0
  g[x_] := If[ x>0, 1, 0]


2) Hold and HoldForm

3) Block and Module

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: ConstrainedMin limited to integer solutions?
  • Next by Date: Comparison of Mathematica on Various Computers
  • Previous by thread: Re: ConstrainedMin limited to integer solutions?
  • Next by thread: Re: Questions on the finer points.