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

[expr.shift] more precise wording for arithmetic shift rounding CWG2724 #6225

Closed
wants to merge 1 commit into from

Conversation

Eisenwave
Copy link
Contributor

Problems with the present wording

rounded down

is sometimes used to describe rounding towards zero, and sometimes to describe rounding towards negative infinity. For example, Java uses java.math.RoundingMode.DOWN to describe rounding towards zero.

It is intuitively clear to the committee and to implementers that this should mirror the semantics of the "arithmetic right shift" instruction (which rounds towards negative infinity), but the wording is not so clear.

Improvements made by the suggested wording

rounded towards negative infinity

is unambiguous.
The wording is also quite popular, e.g. the Wikipedia article on rounding uses it.

@Eisenwave Eisenwave changed the title more precise wording for arithmetic shift rounding [expr.shift] more precise wording for arithmetic shift rounding Apr 7, 2023
@Eisenwave
Copy link
Contributor Author

I've noticed this needs a fixed commit message when merging.

@tkoeppe
Copy link
Contributor

tkoeppe commented Apr 30, 2023

Thanks for raising this, but I think this should be treated as a library issue, and not editorially. Could you please file one?

@jensmaurer
Copy link
Member

@tkoeppe, why would this be a library issue? It's certainly affecting CWG wording.

@jensmaurer jensmaurer added the cwg Issue must be reviewed by CWG. label May 1, 2023
@jensmaurer
Copy link
Member

@Eisenwave , if you want your real name to appear in the core issue, please either change your github settings or send it to me via e-mail.

@jensmaurer
Copy link
Member

CWG2724

@jensmaurer jensmaurer changed the title [expr.shift] more precise wording for arithmetic shift rounding [expr.shift] more precise wording for arithmetic shift rounding CWG2724 May 1, 2023
@Eisenwave Eisenwave closed this Jul 16, 2023
@jensmaurer jensmaurer added this to the post-2023-06 milestone Jul 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants