Skip to content

Conversation

@catamorphism
Copy link
Contributor

According to the spec, the sign argument to NudgeToZonedTime should be either 1 or -1, but in temporal_rs, the Sign type can also represent the 0 sign. Add code to explicitly handle the zero sign case when rounding in nudge_to_zoned_time. This was causing a wrong result when rounding the zero duration (see #646 ).

Closes #646

According to the spec, the sign argument to NudgeToZonedTime should
be either 1 or -1, but in temporal_rs, the Sign type can also represent
the 0 sign. Add code to explicitly handle the zero sign case when rounding
in nudge_to_zoned_time. This was causing a wrong result when rounding
the zero duration (see boa-dev#646 ).
Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for the contribution!

@nekevss nekevss merged commit a8ffa81 into boa-dev:main Dec 10, 2025
8 checks passed
ajperel pushed a commit to chromium/chromium that referenced this pull request Dec 16, 2025
Uplift of boa-dev/temporal#647,
boa-dev/temporal#636, unicode-org/icu4x#7321

Change-Id: Icf703e2ae907a6a820b6b1141883ed9ab825874c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7261567
Commit-Queue: Manish Goregaokar <manishearth@google.com>
Auto-Submit: Manish Goregaokar <manishearth@google.com>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1559085}
mohd-akram pushed a commit to gsource-mirror/chromium-src-third_party-rust that referenced this pull request Jan 9, 2026
Uplift of boa-dev/temporal#647,
boa-dev/temporal#636, unicode-org/icu4x#7321

Change-Id: Icf703e2ae907a6a820b6b1141883ed9ab825874c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7261567
Commit-Queue: Manish Goregaokar <manishearth@google.com>
Auto-Submit: Manish Goregaokar <manishearth@google.com>
Reviewed-by: Łukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1559085}
NOKEYCHECK=True
GitOrigin-RevId: 2add15315bfaeaba94238f5b0e8505da7fe1ae4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rounding zero duration returns wrong result

2 participants