Reputation: 10390
I read that you can specify the max limit of int
to be 11. Why is this if in 4294967295 there are only 10 digits?
Upvotes: 1
Views: 1140
Reputation: 885
It is the "display width", not the maximum storage size. That means it can take ten characters to write the digits and perhaps one character for a minus sign in the negative case, so 11 characters are the most necessary to write the integer.
For more info, see:
http://waynewhitty.ie/blog-post.php?id=19
and
https://blogs.oracle.com/jsmyth/entry/what_does_the_11_mean
Upvotes: 5