Is 1 zero or nonzero?



I haven't followed this whole email chain, but I believe asksign is
supposed to throw an error on non-real arguments unless *complexsign* = T.

I tried tracing asksign1/sign1/absarg to get some insight into this
problem, but I don't get the "Is 1 zero..." question in 5.26.0/SBCL.

                 -s

On Fri, Jun 15, 2012 at 11:46 AM, Robert Dodier <robert.dodier at gmail.com>wrote:

> On 2012-06-15, Barton Willis <willisb at unk.edu> wrote:
>
> >   (%i7) polarform(%i  * inf);
> >   "Is  "1"  zero or nonzero?"zero;
> >   (%o7) %e^((%i*%pi)/2)*inf
>
> Thanks, Barton. The "Is 1 zero ..." is due to ASKSIGN1 not handling
> SIGN1's return value correctly. ASKSIGN1 first tries SIGN1 to see if it
> can determine the sign without asking. SIGN1 correctly returns
> $IMAGINARY for $%I, but ASKSIGN1 doesn't have any case for that.
> The following patch fixes that. With that in place (and the modified
> version of ABSARG) I get:
>
> (%i2) polarform (%i * inf);
> (%o2) %e^(%i*%pi/2)*inf
>
> Dunno if that's right; seems like it might want to be 'infinity.
>
> I think I'll commit the patch even though it's not needed for the
> current version of ABSARG since it seems like an oversight to omit the
> imaginary case.
>
> best
>
> Robert Dodier
>
> PS.
> diff --git a/src/compar.lisp b/src/compar.lisp
> index 96e0bce..e9b2ec3 100644
> --- a/src/compar.lisp
> +++ b/src/compar.lisp
> @@ -884,7 +884,7 @@ relational knowledge is contained in the default
> context GLOBAL.")
>     (sign1 $askexp))
>   (cond ((has-int-symbols $askexp)
>         '$pnz)
> -       ((member sign '($pos $neg $zero) :test #'eq) sign)
> +       ((member sign '($pos $neg $zero $imaginary) :test #'eq) sign)
>        ((null odds)
>         (setq $askexp (lmul evens)
>               sign (cdr (assol $askexp locals)))
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>