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

Compiler manual is not that clear about int literal #7304

Closed
StefanSalewski opened this issue Mar 6, 2018 · 5 comments
Closed

Compiler manual is not that clear about int literal #7304

StefanSalewski opened this issue Mar 6, 2018 · 5 comments
Labels
Documentation Related to documentation content (not generation).

Comments

@StefanSalewski
Copy link

As forum user lscrd reported, this text is not fully correct about int literals:

There exists a literal for each numerical type that is defined. The suffix starting with an apostrophe (''') is called a type suffix. Literals without a type suffix are of the type int, unless the literal contains a dot or E|e in which case it is of type float.

At a different position this correct explanation exists:

An integer literal that has no type suffix is of this type if it is in the range low(int32)..high(int32) otherwise the literal's type is int64.
@twetzel59
Copy link
Contributor

@StefanSalewski I have looked at the forum, and I am interested in improving the manual. Do you mind clarifying what is wrong with the first statement?

As I think I understand, it could read (as an example):
... of the integer type of the minimum width to represent the value, unless the literal contains a dot or E|e in which case it is of type float.

@StefanSalewski
Copy link
Author

twetzel, sorry english is not my native language, so I have some problems to give a good suggestion.

Your suggestions is wrong, because integer literals are of type int or int64, but never something like int16.

Maybe we could write: "Literals without a type suffix are of AN INTEGER type, unless the literal contains a dot or E|e in which case it is of type float." "This INTEGER type is type int if the literal is in the range low(int32)..high(int32) otherwise the literal's type is int64."

@twetzel59
Copy link
Contributor

twetzel59 commented Mar 6, 2018

Off the top of my head, that sounds correct :)

@twetzel59
Copy link
Contributor

I'll consider making a pull request once I write the changes, possibly tomorrow or sometime in the next few days :)

@andreaferretti andreaferretti added the Documentation Related to documentation content (not generation). label Mar 7, 2018
@twetzel59
Copy link
Contributor

I'm going to work on this now.

@Araq Araq closed this as completed in d20729e Mar 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Related to documentation content (not generation).
Projects
None yet
Development

No branches or pull requests

3 participants