Re: long double precision
On Nov 16, 10:55 pm, "BobR" <removeBadB...@worldnet.att.net> wrote:
Markus Moll wrote in message...
What does MSVC++ say about sizeof(long double) vs sizeof(double)?
I asked My Second Virtual Cousin (twice added), and he said nothing! <G>
In Assembler, I used to use eight-byte(dd) and ten-byte(dt) types. That's
not even close to "twice the size" (If we're talking number of bits).
[ assembler == a386 ]
And g++ on a PC, at least in some configurations, uses 8 and 12
bytes.
At the hardware level, there are 10 bytes of information in an
Intel long double. But 10 bytes results in some awkward
alignments. Microsoft, from what I understand, punts on the
question, by ignoring the hardware long double type (which is
conform, if not very useful). G++ originally chose to use 12
bytes (with 2 garbage bytes) according to alignment
considerations on some older machines: with modern hardware,
unless you have 16 bytes alignment, you might as well go with
10. (I'm not sure, but there may also be options to control
this.)
Once again, there is no right answer.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34