How to make "Is x zero or nonzero?" in my function



On 11/06/2012 6:11 PM, Evgeniy Maevskiy wrote:
> In my Maxima-function I have to ask the user
>
> Is x zero or nonzero?
> Is x positive or negative?
>
You want the asksign function.

%i1) asksign(x);
Is  x  positive, negative, or zero?

p;
(%o1)                                 pos
(%i2) asksign(x^2);
Is  x  zero or nonzero?

z;
(%o2)                                zero