I think that numberp means "lisp number" which is a data type
question, not a mathematical question. If %i becomes a lisp
number it would become numberp instead of a constant. If it
breaks any maxima program I would find that surprising.
as for 1/(1+%i) simplifying as Stavros points out,
I think that if %i is a common lisp number, that would be OK.
E
ven if 1/(a+%i*b) would
not be canonicalized except if requested. Minor inconsistencies
are inevitable. Sometimes people want one form, and sometimes
the other.
Rjf
Stavros Macrakis wrote:
>>>>Is numberp(%i) true?
>>>>
>>>>
>>>Does anyone know the reason for this?
>>>
>>>
>>My totally uninformed guess would be that numberp was written
>>when maxima only supported real numbers. Complex numbers
>>were added later, and numberp wasn't changed.
>>
>>
>
>I'm not sure about the history, but I suspect that %i has been there for
>a long time. I don't think you should try too hard to find a completely
>cogent and consistent explanation for things like this.
>
>But one relevant fact is that the general simplifier does not put
>expressions involving %i into canonical form -- e.g. 1/(1+%i) does not
>automatically simplify to 1/2-%i/2. A consequence of using CL
>arithmetic to represent %i is that it *would* automatically become
>1/2-%i/2. I am not sure whether this is a good thing. When
>manipulating complex numbers, do you always want them canonicalized?
>That said, numberp's are not closed under ^, and expressions in ^ are
>not canonicalized -- sqrt(11+6*sqrt(2)) does not simplify to 3+sqrt(2).
>
>Note, by the way, that %e, %pi, and sqrt(2)=2^(1/2) aren't numberp
>either. All of these are constantp, on the other hand.
>
>Does someone want to propose (and defend) a better definition for
>numberp?
>
> -s
>
>_______________________________________________
>Maxima mailing list
>Maxima@www.math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima
>
>