Why is the maximum number of integer values per fixed-length variable sightly more than the amount of values for the previous one squared?

41 Views Asked by At

For example; an 8-bit variable can have 255 total values. 255 squared is 65,025, but the amount of total values for a 16-bit variable is 65,536. Where do these extra 511 values come from?

1

There are 1 best solutions below

0
On BEST ANSWER

Actually an 8 bit variable can have $2^8=256$ values and a $16$ bit one can have $2^{16}=65536=256^2$ different values.