Repository navigation
Closes 5113, fixing behavior of floor division operator (//) - #5131
Merged
Merged
Conversation
drculhane
force-pushed
the
Closes-5113
branch
from
December 9, 2025 17:34
29b003f to
72ccf64
Compare
1RyanK
approved these changes
Dec 10, 2025
1RyanK
left a comment
Contributor
There was a problem hiding this comment.
I think the PR is mostly correct, just a bit of a concern here.
1RyanK
reviewed
Dec 18, 2025
drculhane
force-pushed
the
Closes-5113
branch
from
January 13, 2026 20:49
92692eb to
739236a
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5131 +/- ##
========================================
Coverage ? 100.00%
========================================
Files ? 4
Lines ? 63
Branches ? 0
========================================
Hits ? 63
Misses ? 0
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 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.
Closes #5113
Update -- after a chat with Ryan, I realized that it wasn't really enough to correct the behavior of // without also distributing it. So this version does that, with a new function called floorDivision, which calls a slightly changed floorDivisionHelper.
There are three versions of floorDivision, for the vv, vs and sv cases.
All of the calls to floorDivisionHelper in BinOp, which were zippered foralls, now call floorDivision.
I also changed the calls to floorDivisionHelper in TimeClassMsg.chpl and OperatorMsg.chpl.
Also at Ryan's suggestion, I removed "inline" from the declaration of floorDivisionHelper. I haven't yet addressed ModHelper. That will be in the PR for the behavior of the % operator.
Previously -- I modified floorDivisionHelper to handle more data types, and invoked it in places where chapel had been performing a simple (and incorrect) a/b division.