Menu

#4760 crazy question: Is "1" zero or nonzero? from one-arg limit

None
open
nobody
None
5
2 hours ago
23 hours ago
No

This should either ask for the parity of n, or return something like (-1)^n * minf. It should not ask if `1' is zero or nonzero.

(%i1)   declare(n,integer)$

(%i2)   assume(n < 0)$

(%i3)   limit((-1)^n/zerob);
"Is "1" zero or nonzero?"nz;
(%o3)   minf

Discussion

  • Stavros Macrakis

    Stavros Macrakis - 22 hours ago

    Agreed this is a bug.

    Single-argument limit isn't supposed to return things like (-1)^n*minf, but to resolve them. In this case, I think the only correct result is infinity, which is what it returns for limit((-1)^x/zerob) and limit((-1)^(-x^2-1)/zerob) with no declarations on x.

     
  • Barton Willis

    Barton Willis - 2 hours ago

    FYI: For the bit of code I was working with, I worked around this bug by using ask-integer to determine the parity of the integer. Not ideal, but it works.

     

Log in to post a comment.