Repository navigation
Compile mod over Complex in the LINQ compiler - #2210
Merged
Merged
Conversation
The modulo operator is not defined for System.Numerics.Complex, so Compile<Complex, ...> refused x mod 3. It now takes the remainder Compile already takes, RealOnly.Mod: the floored one where both sides are real, and NaN where either is not, as the interpreter leaves it unevaluated. Over the reals nothing changes. Part of #2195 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2210 +/- ##
=======================================
Coverage 86.57% 86.58%
=======================================
Files 302 302
Lines 67045 67053 +8
Branches 19469 19470 +1
=======================================
+ Hits 58045 58056 +11
+ Misses 4897 4895 -2
+ Partials 4103 4102 -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.
Part of #2195:
modoverComplex, which the LINQ compiler refused (The binary operator Modulo is not defined for the types 'System.Numerics.Complex').Over
Complexit now takes the remainderCompile(FastExpression) already takes,RealOnly.Mod: the floored remainder where both sides are real, andNaNwhere either is not, as the interpreter leaves(2 + i) mod 3unevaluated. The two compilers agree, and over the reals nothing changes."x mod 3".ToEntity().Compile<Complex, Complex>("x")7,-7,2 + iUncompilableNodeException1,2,NaNTests:
TheLinqCompilerTakesTheStackMachinesRemainderOverTheComplexNumbers. Full suite 17899/0, interactive trio, AOT smoke 66/0, all frameworks build (on the master before #2209; the chain runs on this branch).🤖 Generated with Claude Code
https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura