Richard Heathfield said:
Jack Klein wrote: [...]
So let's try...
It is an integer type that is required to have at least 64 bits,
meaning it must have at least twice the range of the minimum required
range for long.
That's a much /better/ description, though.
Well, it's true that long long has to have at least twice the range of
the minimum required range for long. In fact, it has to have at least
2**32 times the range (assuming that "range" means something like the
number of values it can represent).
Statements about relative sizes rather than relative ranges are
slightly iffy. It's possible (I think) to have
sizeof(long) > sizeof(long long)
if long has more padding bits than long long. I can even imagine a
reason to do it this way. Type long uses the mantissa bits of an
80-bit floating-point type and treats the exponent as padding bits.
Given the hypothetical hardware, this turns out to be the most
efficient way to implement 32-bit integer arithmetic; a mode bit in
the floating-point instructions lets you specify that the exponent has
a fixed value. This 80-bit floating-point type has at least 32 bits
of mantissa, but fewer than 64, so long long is implemented as a pure
64-bit integer type, and operations on it are implemented in some less
efficient way.
I doubt that this would make sense on any real hardware, but I think
it's allowed by the standard.