> On my compiler VC++, the size is 8 bytes and its alignment is also 8.
Repeat: size, alignment and value-representation of
Subject to the proviso that:
the precision that
provides is not less than
the precision that a double provides.
(It may be
the set of values that the type
can hold is a (not necessarily proper
) superset of the set of values that the type
> Also what does double have to do with long double?
Both are ﬂoating point types; due to the provisions a.
the conversion from a
is a narrowing conversion
> Aren't they both completely different types???
They are two different types. However, they may (or may not) have the same object representation. Even if they happen to have the same object representation (the same value representation, the same size and the same alignment) on a particular implementation,
are two distinct fundamental types.
> I really like making sure I know and understand it.
The basic idea is extremely simple; you are unnecessarily complicating it by trying to factor in completely irrelevant issues like size.
|Object types have alignment requirements which place restrictions on the addresses at which an object of that type may be allocated. An alignment is an implementation-deﬁned integer value representing the number of bytes between successive addresses at which a given object can be allocated. An object type imposes an alignment requirement on every object of that type |
Alignments have an order from weaker to stronger or stricter alignments. Stricter alignments have larger alignment values. An address that satisﬁes an alignment requirement also satisﬁes any weaker valid alignment requirement.
Comparing alignments is meaningful and provides the obvious results:
— Two alignments are equal when their numeric values are equal.
— Two alignments are diﬀerent when their numeric values are not equal.
— When an alignment is larger than another it represents a stricter alignment.
Incidentally, the term 'more stringent alignment requirement
' that I used earlier has the same meaning as the term 'stronger or stricter alignment
' used by the IS.