Skip to content

A limit of an expression built on floor or sgn is answered by substitution at the jump #2266

Closed

Description

@Rafael-SOWNet

A limit of an expression built on floor or sgn is answered by substituting the destination, at the jump too, so a one-sided limit, and the two-sided one that does not exist, get the value at the point. A bare floor(x) or sgn(x) is declined, as it should be, but anything built on it is not. 2.6.0 and master:

answered is
limitleft(floor(x) - 1, x, 0) -1 -2
limit(floor(x) - 1, x, 0) -1 none: -2 from the left, -1 from the right
limitleft(floor(x)^2, x, 0) 0 1
limitleft(arcsin(floor(x)), x, 0) 0 -pi/2
limitleft(-sgn(x), x, 0) 0 1
limitright(-sgn(x), x, 0) 0 -1
limit(floor(x) + x, x, 1) 2 none: 1 from the left, 2 from the right

The same substitution answers at a branch cut. limitright(ln(x^x), x, -1) is ln(-1), which is i pi, but x^x approaches -1 from below the cut there, so the limit is -i pi.

Found by a new workspace harness, work/limitcheck, which compares a limit with the values approaching it. Over 600 random expressions, 54 limits are of this kind.

Activity

  1. added this to the 2.7.0 milestone on Oct 30, 2026
  2. Rafael-SOWNet commented on Oct 31, 2026

    @Rafael-SOWNet
    MemberAuthor

    Done in three PRs, now on master (2c9dceb):

    master
    limitleft(floor(x) - 1, x, 0) -2
    limit(floor(x) - 1, x, 0) NaN
    limitleft(floor(x)^2, x, 0) 1
    limitleft(arcsin(floor(x)), x, 0) -pi/2
    limitleft(-sgn(x), x, 0) 1
    limitright(-sgn(x), x, 0) -1
    limit(floor(x) + x, x, 1) NaN
    limitright(ln(x^x), x, -1) unevaluated

    One known cost: a limit that arrives on the cut from above is declined too, though its value was right. #2294 says why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions