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

0xFF000000_0000000000000 should error with value out of range; instead treated as 0 #14529

Closed
timotheecour opened this issue Jun 1, 2020 · 5 comments
Labels

Comments

@timotheecour
Copy link
Member

0xFF000000_0000000000000 should error with value out of range; instead treated as 0

Example

block:
  echo 0xFF000000_0000000
  echo 0xFF000000_00000000
  echo 0xFF000000_000000000
  echo 0xFF000000_0000000000
  echo 0xFF000000_00000000000
  echo 0xFF000000_000000000000
  echo 0xFF000000_0000000000000

Current Output

1148417904979476480
-72057594037927936
-1152921504606846976
0
0
0
0

Expected Output

echo 0xFF000000_0000000000

this should give error: value out of range

Additional Information

found that while working on #14522
177c7f9 1.3.5

the fact that 0xFF000000_0000000 is treated as signed instead of unsigned is a separate issue, to be discussed sepately

@alaviss
Copy link
Collaborator

alaviss commented Jun 1, 2020

the fact that 0xFF000000_0000000 is treated as signed instead of unsigned is a separate issue, to be discussed sepately

IIRC there were proposals to make this uint but was met with enough resistance that it didn't take off.

Maybe now we should re-propose this as an RFC?

@timotheecour
Copy link
Member Author

timotheecour commented Jun 1, 2020

IIRC there were proposals

do you have a link?
current behavior causes absurdities such as #14522

@alaviss
Copy link
Collaborator

alaviss commented Jun 1, 2020

I can't find it, though @Araq has said on record many times that hex as int is intentional, so maybe he can expand on the topic.

@Araq
Copy link
Member

Araq commented Jun 1, 2020

0xFF000000_00000000.uint64 should be 0xFF000000_00000000'u64. Hex numbers should have suffixes anyway that's why I rejected the proposal.

@ringabout
Copy link
Member

Duplicate of #4350

@ringabout ringabout marked this as a duplicate of #4350 Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants