Is 1 zero or nonzero?



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)))