Re: TELLING PROGRAM THAT A VARIABLE IS AN INTEGER
- To: mathgroup@smc.vnet.net
- Subject: [mg11558] Re: [mg11488] TELLING PROGRAM THAT A VARIABLE IS AN INTEGER
- From: Sean Ross <seanross@worldnet.att.net>
- Date: Sat, 14 Mar 1998 13:56:11 -0500
- References: <199803131721.MAA03631@smc.vnet.net.>
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.
- References:
- TELLING PROGRAM THAT A VARIABLE IS AN INTEGER
- From: blimbaum_jerry@ccmail.ncsc.navy.mil
- TELLING PROGRAM THAT A VARIABLE IS AN INTEGER