Re: A riddle: Functions that return unevaluated when they cannot
- To: mathgroup at smc.vnet.net
- Subject: [mg82502] Re: A riddle: Functions that return unevaluated when they cannot
- From: P_ter <peter_van_summeren at yahoo.co.uk>
- Date: Mon, 22 Oct 2007 05:43:48 -0400 (EDT)
In The Mathematical Journal Volume 7, issue 2 there is an article from Bruce Miller "A function which does not evaluate".(page 149). Sin[x] does not evaluate because x is undefined. f[q_?NumberQ]:= q^2 gives with f[x]: f[x] and with f[2.718] 7.38752. Of course, again and again: Clear[f] But, with f[(n_?Positive)?IntegerQ]:=n! f[n_]:= Print["f expects a positive integer argument"] Try f[2.4] It is the way some functions are implemented that they do not a "should" evaluate. with friendly greetings, P_ter