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

what is problem ? #29815

Closed
Phoenix1112 opened this issue Jan 18, 2019 · 5 comments
Closed

what is problem ? #29815

Phoenix1112 opened this issue Jan 18, 2019 · 5 comments

Comments

@Phoenix1112
Copy link

hello.. I am learning golang software language ...but I am facing a problem.. i am using go version go1.11.4 in my computer. I'm learning this topic right now "Signed integers".. I have some simple codes in my hand...results on this site do not match the results on the computer (https://play.golang.org/p/mFsmjVk5oc)

1

2

play.golang.org >>> size 4
my compter >>>> size 8 ?????

Is this a golang version error?

@as
Copy link
Contributor

as commented Jan 18, 2019

No. The play.golang run on the 32 bits system.

@Phoenix1112
Copy link
Author

In other words, 32-bit system results in different results, 64-bit systems are different results?

My computer 64-bit system

@ALTree
Copy link
Member

ALTree commented Jan 18, 2019

In other words, 32-bit system results in different results, 64-bit systems are different results?

Yes, as as said, the size of an int variable is implementation-specific, and it's usually 32-bit on 32-bit systems, and 64-bit on 64-bit systems.

Closing here, since your question has been answered.

@ALTree ALTree closed this as completed Jan 18, 2019
@ianlancetaylor
Copy link
Contributor

Yes, the size of int is different on different systems.

@Phoenix1112
Copy link
Author

Thanks

@golang golang locked and limited conversation to collaborators Jan 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants