Repository navigation
An exact rational is zero, positive or negative as it is - #2280
Merged
Merged
Conversation
0 / 10^(-200) was NaN, where it is 0, and so was 0 ^ (1/10^250). Complex.IsZero and Real.IsPositive and IsNegative read the decimal, and a rational's decimal is written out in the precision context, whose exponent range writes every rational under about 1e-199 in size as 0. So the divisor was taken for zero, and the exponent for not positive. That is what made #2270's reduced row echelon form NaN, dividing 0 by a denominator near 1e-246. A rational part is now read by its ERational, which it holds; its decimal is written out only when asked for. ATinyRationalIsNotZeroTest takes five quotients and powers of tiny rationals, three that have not changed, and the sign and the zero test of 1/10^250 and its negation; six fail on master. The suite, the trio, F#, AOT and the eight harnesses pass. Diagnosed by the subagent that traced #2270. Fixes #2277. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2280 +/- ##
=======================================
Coverage 86.71% 86.71%
=======================================
Files 310 310
Lines 67845 67847 +2
Branches 19689 19691 +2
=======================================
+ Hits 58830 58835 +5
+ Misses 4895 4891 -4
- Partials 4120 4121 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
0 / 10^(-200)was NaN, where it is 0, and so was0 ^ (1/10^250).Complex.IsZero,Real.IsPositiveandReal.IsNegativeread the decimal. A rational's decimal is written out in the precision context, whose exponent range writes every rational smaller than about 1e-199 as 0. So the divisor was taken to be zero, and the exponent to be not positive. This is what made #2270's reduced row echelon form NaN: it divided 0 by a denominator near 1e-246.A rational part is now read by the
ERationalit holds. Its decimal is written out only when asked for, so these checks no longer write one out.0 / 10^(-200)NaN00 / (3/10^260)NaN00 ^ (1/10^250)NaN0ATinyRationalIsNotZeroTest: 6 of its 9 cases fail on master, and the 3 for things that have not changed pass on both. The suite (18,265), the trio, F#, AOT and the eight harnesses pass locally.Left out on purpose:
0 % (1/10^250)is still NaN, through Real's decimal%.1/10^250 = 0isTrue, which isEqualsf's tolerance (#1019).Fixes #2277.
🤖 Generated with Claude Code