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

Subranges of integers #52

Open
certik opened this issue Oct 27, 2019 · 3 comments
Open

Subranges of integers #52

certik opened this issue Oct 27, 2019 · 3 comments
Labels
Clause 7 Standard Clause 7: Types

Comments

@certik
Copy link
Member

certik commented Oct 27, 2019

Extracted from #49. Author: Van Snyder

Reference: 04-140r1.

Unsigned integers, and integers that have nondecimal range, are frequent requests. These
requests could be satisfied, and numerous other benefits provided as well, by providing for
named subranges of integers.

One of the additional benefits is that checking of subscript bounds can be done at compile
time: If the bounds of an array are specified by a subrange name, and if in that case the only
subscripts are of that subrange, one only need check when the subscript gets a value, not when
it’s used as a subscript. If DO control is defined by reference to the subrange, say by using
TINY and HUGE, even that check can frequently be avoided.

Another benefit is that one can get most (or perhaps all) of the desired functionality of a BIT
type by specifying a constant subrange of 0:1.

@gronki
Copy link

gronki commented Oct 28, 2019

Unsigned integers -- very important IMHO. Dominik

@certik
Copy link
Member Author

certik commented Oct 28, 2019

@gronki Specifically for unsigned integers, we have a dedicated issue at #2.

@swpoole
Copy link

swpoole commented Apr 19, 2020

The lack of unsigned integers has for some communities, caused a migration to C/C++ or other more modern languages. Having unsigned_integer capabilities would be extremely useful in a number of computational venues.

@certik certik added the Clause 7 Standard Clause 7: Types label Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clause 7 Standard Clause 7: Types
Projects
None yet
Development

No branches or pull requests

3 participants