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] p12 Saying that "range of representable values" is implementation-defined is helpful #5546

Open
xmh0511 opened this issue Jul 2, 2022 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Jul 2, 2022

[basic.fundamental] p12 says

The value representation of floating-point types is implementation-defined.

For other integer types, we did not emphasize this point for them. Isn't the value representation for integer types also implementation-defined? Consider the impact for the value representation with the difference between big-endian and little-endian in a concrete environment, and assume the width for short int is always16.

short i = 2;
//  big-endian 00000000 00000010
// little-endian 00000010 00000000

The example wants to convey that saying the value representation is implementation-defined does not mean the range of representable values is implementation-defined too.

So, saying that the value representation of floating-point types is implementation-defined is not all that important here. It is not helpful for interpreting whether a floating-pointer type can represent positive infinity or not. As said in #5407 (comment), we consider the existence of these values for a floating-pointer type is implementation-defined, which means that we care more about the range of representable values. I think, change the above rule to that

The range of representable values for floating-pointer types is implementation-defined.

which is more helpful.

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

No branches or pull requests

1 participant