Is %i an integer? - Adding more facts to the database



-----Urspr?ngliche Nachricht-----
Von: Richard Fateman [mailto:fateman at cs.berkeley.edu] 
Gesendet: Sonntag, 28. Juni 2009 19:33
An: Dieter Kaiser
Cc: Maxima List
Betreff: Re: [Maxima] Is %i an integer? - Adding more facts to the database

> A symbol that is declared to be rational can also be an integer.
> Same for real.
> Maybe even complex, if the imaginary part is zero.

> So is this change wrong?

> Is nonintegerp(x) :=  is not(integerp(x))  ??


I think the functionality of featurep is bit wired.

We declare n to be an integer:

(%i1) declare(n,integer);
(%o1) done

And we get:

(%i2) featurep(n,integer);
(%o2) true
(%i3) featurep(n,real);
(%o3) true
(%i4) featurep(n,complex);
(%o4) true

Now we declare x to be real:

(%i5) declare(x,real);
(%o5) done

>From the mathematical viewpoint x can be an integer too, but the answer of
featurep is false:

(%i6) featurep(x,integer);
(%o6) false

But the answer for real and complex is true again:

(%i7) featurep(x,real);
(%o7) true
(%i8) featurep(x,complex);
(%o8) true

Therefore, from the viewpoint of the implemented function featurep a symbol
which is declared to be real is also a noninteger.

For the practical aim of programming it is necessary to have a convention which
will work. We might change the behavior of featurep or we might use it as it is
and document the behavior better.

Dieter Kaiser