Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporal.Instant.p.round is spec'ed to round signed nanoseconds, contrary to tests #2191

Closed
rkirsling opened this issue May 10, 2022 · 1 comment · Fixed by #2210
Closed
Assignees
Labels
normative Would be a normative change to the proposal spec-text Specification text involved

Comments

@rkirsling
Copy link
Member

rkirsling commented May 10, 2022

Tests were recently added to ensure that rounding is always with respect to the Big Bang, yet the current spec for Temporal.Instant.prototype.round operates directly on instant.[[Nanoseconds]], which can be negative.

I'm guessing the spec needs updating?

@ptomato ptomato added spec-text Specification text involved normative Would be a normative change to the proposal labels May 12, 2022
@ptomato ptomato self-assigned this May 17, 2022
ptomato added a commit that referenced this issue May 18, 2022
…t V3

We intend to standardize on the same rounding modes as Intl.NumberFormat
(see #1038), so it makes sense to use the same abstract operations, namely
GetUnsignedRoundingMode and ApplyUnsignedRoundingMode.

Note that this does not yet add user-visible support for the full set of
rounding modes that Intl.NumberFormat does; that (#1038) is a normative
change that we'll apply once Intl.NumberFormat goes to Stage 4.

However, this way of expressing rounding makes it easier to make that
change in the future, and makes it easier to address #2191 in the short
term.

RoundTowardsZero stays the same, since that is used for several other
things as well as rounding according to a rounding mode.
Ms2ger pushed a commit that referenced this issue May 19, 2022
…t V3

We intend to standardize on the same rounding modes as Intl.NumberFormat
(see #1038), so it makes sense to use the same abstract operations, namely
GetUnsignedRoundingMode and ApplyUnsignedRoundingMode.

Note that this does not yet add user-visible support for the full set of
rounding modes that Intl.NumberFormat does; that (#1038) is a normative
change that we'll apply once Intl.NumberFormat goes to Stage 4.

However, this way of expressing rounding makes it easier to make that
change in the future, and makes it easier to address #2191 in the short
term.

RoundTowardsZero stays the same, since that is used for several other
things as well as rounding according to a rounding mode.
@ptomato
Copy link
Collaborator

ptomato commented May 19, 2022

@rkirsling #2210 should fix this, would you be able to take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
normative Would be a normative change to the proposal spec-text Specification text involved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants