Fix bug with rounding with zoned RelativeTo and increment#696
Merged
Manishearth merged 1 commit intoboa-dev:mainfrom Mar 20, 2026
Merged
Fix bug with rounding with zoned RelativeTo and increment#696Manishearth merged 1 commit intoboa-dev:mainfrom
Manishearth merged 1 commit intoboa-dev:mainfrom
Conversation
7e8154f to
0e9d5c6
Compare
Contributor
Author
|
No new failures. I'm going to patch this in upstream. |
f3bdb5c to
7d6a73d
Compare
nekevss
approved these changes
Mar 20, 2026
Member
nekevss
left a comment
There was a problem hiding this comment.
Confirmed, no new failures in Boa also.
I did have one question, but approving the PR as is.
| ..Default::default() | ||
| }; | ||
|
|
||
| // let result = duration.round(options.clone(), None).unwrap(); |
Member
There was a problem hiding this comment.
question: why is this commented out?
Contributor
Author
There was a problem hiding this comment.
Leftover from debugging
7d6a73d to
72c8a7f
Compare
72c8a7f to
0f0a8e7
Compare
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.
I only somewhat understand the math here, but opening a PR so @nekevss can look at it.
This is really two fixes:
nudge_calendar_unithad swapped the mathUnsignedRoundingMode::apply()was comparingdividendanddivisorwithout looking atr1andr2, which meant it was ignoring the increment.Somehow they were canceling out. We should carefully run test262 on this before landing.
I'm not sure if the math here is safe to perform. It's frustrating that the spec handwaves this by speccing something unimplementable (NudgeToCalendarUnit step 15) and then having a implementation note: this is the second bug today (#695) where I am dealing with bugs arising from spec text that is not directly implementable.