Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-35485: New comparison mode to lazy series and better undefined check
<!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> This fixes #35071 by: 1. providing a method to streams to see if they are unitinalized 2. includes a new mode for comparisons in the lazy series ring based on the proposal in #35429. The new comparison mode `secure` simply returns `False` when it cannot verify that `f == g` and makes sure that `(f == g) == not (f != g)`, and this will become the new default. In particular, it will return `True` for `f != g` both when it cannot show that `f == g` and when they are genuinely different. In order to verify when the comparison is unknown, we expose the `is_nonzero()` that only returns `True` when the series is _known_ to be nonzero. Thus, we verify by `(f - g).is_nonzero()`. When a finite halting precision is given, then that takes priority. For the infinite halting precision in the "old" version (`secure = True`), it will raise a `ValueError` when it cannot verify the result. **NOTE:** `f.is_zero()` is still the default `not f` for speed and the assumption these are in agreement elsewhere in Sage. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35485 Reported by: Travis Scrimshaw Reviewer(s): Martin Rubey, Travis Scrimshaw
- Loading branch information