Skip to content

Answer a limit on a side that is not real with its directed infinity where the phase settles #2697

Description

@Rafael-SOWNet

Follow-up to #2693. #2696 leaves a limit unevaluated where the side approached is not real and Gruntz's algorithm would have read an exponential as positive. That removes the wrong +oos, but some of these limits have a well-defined directed infinity: the modulus grows without bound while the argument settles.

On the principal branch, with mpmath at 60 digits:

limit at 0- abs at x = -1e-10, -1e-20, -1e-40 arg / pi at the same points directed limit master #2696
x^(x - 1) 1e10, 1e20, 1e40 1.0 -oo +oo (wrong) unevaluated
(e^x - 1)^(x - 1) 1e10, 1e20, 1e40 1.0 -oo +oo (wrong) unevaluated
x^(x - 2) 1e20, 1e40, 1e80 -1e-10, -1e-20, -1e-40 +oo +oo unevaluated
sin(x)^(x - 2) 1e20, 1e40, 1e80 -1e-10, -1e-20, -1e-40 +oo unevaluated (pinned) unevaluated

Master already answers this shape elsewhere with a directed infinity. ln(x) at 0- is -oo (the value is ln|x| + i pi), sqrt(x)/x at 0- is -ooi, and x^(1/2) at -oo is +ooi.

Proposal:

  • Where the side is not real, read an exponential's sign from its phase when the phase tends to a constant: e^(-i pi) is -1 and e^(-2 i pi) is 1.
  • Answer with the matching directed infinity: +oo, -oo, +ooi or -ooi.
  • Decline when the phase does not settle. For example, x^(1/x) at 0- has phase pi/x, which keeps turning while the modulus grows, so its limit is the undirected complex infinity.
  • Change the test that pins sin(x)^(x - 2) at 0- as unevaluated (AnExponentThatOnlyTendsToAWholeNumberIsLeftAloneUnderANegativeBase) to +oo.

A directed -oo on a side that is not real is not the real negative infinity. It is the same reading master already gives ln(x) at 0-, so this adds no new risk to callers, but it should be stated in the BREAKING-CHANGES entry.

Agreed with the maintainer on 2026-12-04: #2696 merges first with the decline, then this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions