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

hex literals for unsigned ints, sized by digits #197

Closed
StefanKarpinski opened this issue Sep 15, 2011 · 0 comments
Closed

hex literals for unsigned ints, sized by digits #197

StefanKarpinski opened this issue Sep 15, 2011 · 0 comments
Assignees
Labels
speculative Whether the change will be implemented is speculative

Comments

@StefanKarpinski
Copy link
Member

Usually when you use hex notation for numbers, you are trying to create an unsigned value with a particular bit pattern. To facilitate that, it has been proposed that 0x hex integer literals represent unsigned integers of size determined by the number of digits:

  • hex literals with 1-2 digits create Uint8 values
  • hex literals with 3-4 digits create Uint16 values
  • hex literals with 5-8 digits create Uint32 values
  • hex literals with 9-16 digits create Uint64 values

This proposal would make leading zeros meaningful for hex literals, but only in that they affect the storage size of the resulting value, never its numeric value, which seems acceptable and intuitive.

@ghost ghost assigned JeffBezanson Nov 11, 2011
StefanKarpinski added a commit that referenced this issue Dec 14, 2011
* 'master' of github.com:JuliaLang/julia:
  closing issue #197, hex literals give unsigned ints sized by digits
  storing ASTs serialized to save memory part of issue #261 significantly cuts the number of live objects, making GC much faster
StefanKarpinski pushed a commit that referenced this issue Feb 8, 2018
Keno pushed a commit that referenced this issue Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
speculative Whether the change will be implemented is speculative
Projects
None yet
Development

No branches or pull requests

2 participants