-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Unsigned integer parsing problem #6829
Comments
That's not a bug. Unsigned is 32 bits depending on the target and we encourage you to write platform independent code. |
This argument does not make much sense, though:
|
Also:
|
Like it or not, they all adhere to the spec that at least exists in my head. The type of an integer literal is |
Well, that specification is surprising, to say the least:
|
[EDIT: created issue #6838 for this] This problem might be unrelated - I can open a new issue if you prefer:
|
Come up with a better one, what's the alternative? |
I don't know enough of Nim's internals to suggest a workable alternative, but stumbling over things like setting lastOrd(tyUInt64) to 0x7FFFFFFFFFFFFFFF'i64 makes me realize that the intergral type system has grown and was not designed upfront. |
Here is an interesting variation of the problem:
|
Irrelevant code, |
After looking at getNumber() in
|
I suggested once that the type But when complaining about the integer type it is important to take into account that integer literals are not the same as integers. Integer literal are automatically downcasted to a smaller type, if a compile time check ensures no over or underflow. |
this does work now. |
Unsigned integer parsing problem:
The text was updated successfully, but these errors were encountered: