How do I tell Mathematica than n is an integer?
- To: mathgroup at smc.vnet.net
- Subject: [mg9583] How do I tell Mathematica than n is an integer?
- From: morrison at phyast.nhn.ou.edu (michael a. morrison)
- Date: Thu, 13 Nov 1997 01:40:46 -0500
- Organization: University of Oklahoma
- Sender: owner-wri-mathgroup at wolfram.com
In writing some packages for courses I'm teaching, I've run into the
following recurrent difficulty:
How do you tell Mathematica within a notebook session that a variable n
is a positive integer in such a way that a command defined in a package
such as
waveFunction[n_Integer?Positive] := will execute rather than
returning waveFunction[n] unevaluated. Setting
Integer[n] ^= True;
Postive[n] ^= True;
in the notebook has no effect whatsoever on the failure of Mathematica
to evaluate waveFunction[n].
I would be very grateful for any advice anyone can give me!
Thanks---michael morrison (university of oklahoma)
Michael A. Morrison
Dept. Physics & Astronomy
University of Oklahoma
Norman, OK 73019
Phone: 405 325-3961
FAX: 405 325-7557