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

[basic.fundamental] rename 'range exponent' to 'width' #2638

Merged
merged 2 commits into from Mar 15, 2019

Conversation

@jfbastien
Copy link
Contributor

jfbastien commented Jan 5, 2019

Jens Gustedt is working on adopting WG21's changes from wg21.link/p1236r1 into WG14's working paper, and noticed that what WG21 calls 'range exponent' has been called 'width' in the C standard. See 'integer types' in C17:

The precision of an integer type is the number of bits it uses to represent values, excluding any sign and padding bits. The width of an integer type is the same but including any sign bit; thus for unsigned integer types the two values are the same, while for signed integer types the width is one greater than the precision.

C++ should use the same term where it makes sense and ones already exist, as is the case here. Jens wants to get C2x to match C++20, but it seems silly to make them change terms they've used for a long time.

Jens Gustedt is working on adopting WG21's changes from wg21.link/p1236r1 into WG14's working paper, and noticed that what WG21 calls 'range exponent' has been called 'width' in the C standard. See 'integer types' in C17:

  The precision of an integer type is the number of bits it uses to represent values, excluding any sign and padding bits. The width of an integer type is the same but including any sign bit; thus for unsigned integer types the two values are the same, while for signed integer types the width is one greater than the precision.

C++ should use the same term where it makes sense and ones already exist, as is the case here. Jens wants to get C2x to match C++20, but it seems silly to make them change terms they've used for a long time.
@jensmaurer

This comment has been minimized.

Copy link
Member

jensmaurer commented Jan 6, 2019

This looks reasonable. The confusion potential with "width of a bit-field" seems minimal. We should inform CWG about this, since we're changing a defined term.

@jensmaurer jensmaurer added the cwg label Jan 6, 2019
@jfbastien

This comment has been minimized.

Copy link
Contributor Author

jfbastien commented Jan 6, 2019

Something we could do to further reduce the tiny potential for confusion is define "width of an integer", and only use "width" when context makes it obvious. I'm happy to update to this as well.

@jensmaurer

This comment has been minimized.

Copy link
Member

jensmaurer commented Jan 6, 2019

@jfbastien, my cursory look at the changes seems to indicate that we're already sufficiently unambiguous where it matters, in particular in [class.bit].

@jensmaurer

This comment has been minimized.

Copy link
Member

jensmaurer commented Feb 19, 2019

CWG in Kona: approved renaming "range exponent" to "width" editorially.

@jensmaurer jensmaurer removed the cwg label Feb 19, 2019
@zygoloid zygoloid force-pushed the cplusplus:master branch from b094703 to fb99e64 Mar 9, 2019
@hubert-reinterpretcast

This comment has been minimized.

Copy link
Contributor

hubert-reinterpretcast commented Mar 13, 2019

Cross referencing https://cplusplus.github.io/LWG/issue2820, which would refer to the term in question.

@zygoloid zygoloid added this to the post-2019-02 milestone Mar 15, 2019
@jensmaurer

This comment has been minimized.

Copy link
Member

jensmaurer commented Mar 15, 2019

@jfbastien , this needs a rebase.

@zygoloid zygoloid merged commit 0ba5424 into cplusplus:master Mar 15, 2019
1 check was pending
1 check was pending
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@jfbastien jfbastien deleted the jfbastien:range-exponent branch Mar 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.