Fix display of non-thin intervals showing identical bounds#752
Open
Fix display of non-thin intervals showing identical bounds#752
Conversation
Quick-reference page covering the full v1 API: types, constructors, string parsing, ExactReal/NG flag, accessors, decorations, arithmetic, powers, boolean functions, set operations, bisection, display options, configuration, piecewise functions, and common gotchas. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Restore directed rounding for interval display: lower bounds are rounded down and upper bounds are rounded up, ensuring displayed intervals are always valid enclosures. This was accidentally removed in the 1.0 release. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Benchmark Results (Julia v1)Time benchmarks
Memory benchmarks
|
Member
|
The display of intervals is a bit tricky because it is always lying. But indeed, there is an argument to be made that it is better for the display to indicate, at least, that an interval is not thin even if that means showing a wider interval. I'll have a look at the PR. |
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.
Summary
Fixes #751.
RoundDown) and upper bounds are rounded up (RoundUp), so displayed intervals are always valid enclosures of the true interval.BigFloatand used MPFR string formatting with manual digit-level rounding — that approach is restored here.Before:
sin(interval(0.1))displayed as[0.0998334, 0.0998334](identical bounds despite non-zero diameter)After:
sin(interval(0.1))displays as[0.0998334, 0.0998335](distinct bounds, valid enclosure)Test plan
Pkg.test())sin(interval(0.1))now shows distinct boundsinterval(1.0, 1.0)) still display as[1.0, 1.0]🤖 Generated with Claude Code