The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Questions on the finer points.
Replies: 1   Last Post: Jul 28, 1996 11:18 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Hein Hundal

Posts: 3
Registered: 12/7/04
Questions on the finer points.
Posted: Jul 24, 1996 7:14 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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?


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

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

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.