MathGroup Archive 1998

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

Search the Archive

Re: TELLING PROGRAM THAT A VARIABLE IS AN INTEGER



blimbaum_jerry@ccmail.ncsc.navy.mil wrote:
> 
>      How do I tell Mathematica to regard a variable,n for example, as an
> 
>      integer.  Hence, things like Sin(n Pi) = 0.  


As of yet, there is no universal way to tell all of mathematicas
functions that a certain symbol is an integer but without an assigned
value and have all of them react appropriately.  I refer to this
concept as object oriented data typing.  It involves a tremendous
amount of computing and requires that the entire language be set up to
look for such things.  Then there is the question of what kinds of
"data types" to allow.  You might think that there should only be
integers, reals, etc., but then someone else wants all 1562 mathematica
functions to automatically react correctly to a data type defined as a
complex number with a negative real part and an imaginary part greater
than Pi.

As it stands right now, you have to do these things manually and decide
that n is an integer yourself and then define Sin[n Pi]->0.  What would
be really nice is if you could do something like Sin[_Integer Pi]->0
and have that kind of a pattern stick, but that code doesn't work and I
don't know of any way to do that kind of thing without a lot of
programming.  Maybe in version 3.0.5.

-- 
Remove the _nospam_ in the return address to respond.



  • Prev by Date: shuffling a large set in Mathematica
  • Next by Date: Re: Solving Overdetermined Systems
  • Prev by thread: TELLING PROGRAM THAT A VARIABLE IS AN INTEGER
  • Next by thread: Re: TELLING PROGRAM THAT A VARIABLE IS AN INTEGER