3 ms·
> in C, the int type can be as low as 16 bits in size, yielding "65 thousand-something" Wrong both for worst-case C and for "16 bits in size": the actual maxim
by a1369209993 4y ago
> in C, the int type can be as low as 16 bits in size, yielding "65 thousand-something"
Wrong both for worst-case C and for "16 bits in size": the actual maximum is "32 thousand-something" (specifically 32767 in 2s-complement and also in most of the stupid representations (like 1s-complement or sign-magnitude), although there might be some that have, eg, 32768). They also have a minimum of -32768 (or -32767 or otherwise for some of the stupid representations).
You could intepret it as "65 thousand-something" values between the minimum and maximum, but that strongly implies that the minimum doesn't need to be specified, which only works for unsigned integers (which C int is very much not).