Repository navigation
Leave a two-sided limit unevaluated where a side stops at an indeterminate form - #2419
Merged
Rafael-SOWNet merged 1 commit intoNov 13, 2026
Conversation
…inate form A two-sided limit at a finite point compares its sides. When one came back NaN, the answer was NaN: "this does not exist". But the descent also returns NaN for an indeterminate form it could not resolve, such as 0 * floor(-oo) for x * floor(2/x) at 0, whose sides are 2 from each direction. That NaN means "undecided", and turning it into a two-sided NaN answered wrongly where the library had not decided anything. When the sides are asked outright, a side that stops at an indeterminate form with an infinity in it now counts as undecided, and the two-sided limit stays unevaluated. A side that settles as NaN still makes the two-sided limit NaN. So does an indeterminate form with only finite parts, such as 0/0 for (x - x)/(x - x), which does not exist anywhere near the point. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2419 +/- ##
=======================================
Coverage 86.81% 86.81%
=======================================
Files 312 312
Lines 69514 69523 +9
Branches 20300 20305 +5
=======================================
+ Hits 60348 60356 +8
- Misses 4932 4933 +1
Partials 4234 4234
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Rafael-SOWNet
deleted the
feature/an-undecided-side-leaves-a-two-sided-limit-unevaluated
branch
November 13, 2026 11:13
This was referenced Nov 13, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A two-sided limit at a finite point compares the limits from each side. When a side came back NaN, the answer was NaN, which means "this does not exist". But the descent also returns NaN internally for an indeterminate form it could not resolve. For
x * floor(2/x)at 0 that form is0 * floor(-oo), and each side is 2. That NaN means "undecided", and turning it into a two-sided NaN gave a wrong answer where the library had decided nothing.When the sides are asked outright, a side that stops at an indeterminate form with an infinity in it now counts as undecided, and the two-sided limit stays unevaluated. NaN is still the answer when:
0/0for(x - x)/(x - x)orln(-2)/0forln(-2)/ln(x)at 1. These have no value anywhere near the point.x * floor(2/x)NaNNaNfloor(1/x) * sin(x)NaNNaNx^2 * floor(1/x^2)0NaNx * ceil(1/x)NaNNaNfloor(2/x)NaNNaNNaNfloor(x)NaNNaNsin(1/x)NaNNaNNaN(x-x)*sin(x)/((x-x)*x)NaNNaNNaN(abs(x)^(x/pi))^sgn(x)11The first four rows are in BREAKING-CHANGES.md. Answering them with their values needs the floor's
0 * ooresolved from each side, which is a separate change; this one stops the wrong answer. The new test checks that the four rows staylimit(...)nodes, and that the rows without a limit stay NaN.Checked on this branch:
tanh(log(x, -1) - tan(x))at 1 from the right moved into "did not finish in 5 s". It takes 6.2 to 6.6 s on master and 6.3 to 7.1 s on this branch, and is unevaluated on both, so the 5 s cap decides which list it lands in.🤖 Generated with Claude Code