Repository navigation
The signum of a value that does not exist has none - #2243
Merged
Merged
Conversation
Signumf's rule took a real number's sign from its EDecimal, and EDecimal's Sign of NaN is 1. So the signum of anything without a value was 1: sgn(NaN), sgn(0/0), sgn(-1 provided false), and 1 + sgn(-1 provided pi < 3) was 2. That is a value where there is none, on 2.6.0 as on master. Number.Signum already gave NaN for NaN; only this rule did not. A NaN real is now its own signum. abs, sin and the rest already passed a NaN through. Found by comparing the compiled sgn with evaluation for #2242. The compiled value was NaN there, and evaluation's was 1. SignumOfNaNTest: five spellings of a missing value, by Evaled and by Simplify, all failing on master; five signs that stay as they were; and the compiled value. Fixes #2241. 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 #2243 +/- ##
==========================================
+ Coverage 86.68% 86.70% +0.01%
==========================================
Files 310 310
Lines 67766 67785 +19
Branches 19660 19664 +4
==========================================
+ Hits 58744 58770 +26
+ Misses 4909 4902 -7
Partials 4113 4113
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Every one was an InnerSimplified order disagreement on a sum with sgn(a / 0) in it. a / 0 has no value, and its signum was 1, so the two orders of the sum came out as different expressions. sgn(a / 0) is now NaN, which makes the sum NaN in either order. 0 findings appeared, and the baseline goes from 2091 to 2039. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Fixes #2241.
Signumf's rule took a real number's sign from itsEDecimal, andEDecimal'sSignofNaNis1. So the signum of anything without a value was1:sgn(NaN),sgn(0/0)andsgn(-1 provided false), and1 + sgn(-1 provided pi < 3)was2. That is a value where there is none, on 2.6.0 as on master.Number.Signumalready gaveNaNforNaN; only this rule did not.A
NaNreal is now its own signum, asabsandsinalready passed aNaNthrough."sgn(NaN)".ToEntity().Evaled1NaN"sgn(-1 provided false)".ToEntity().Evaled1NaNFound by comparing the compiled
sgnwith evaluation for #2242: the compiled value wasNaNthere, and evaluation's was1.Tests:
SignumOfNaNTesthas five spellings of a missing value, checked byEvaledand bySimplify, all of which fail on master; five signs that stay as they were; and the compiled value. Full suite 18124/0, interactive trio, AOT smoke 73/0, all frameworks build.🤖 Generated with Claude Code