Mail Archives: djgpp/1997/03/06/07:07:30
Thomas Knudsen wrote:
>
> Based on the figures in float.h, I have always believed, that a long
> double in djgpp corresponded to an 80 bit IEEE float. However, the
> following code fragment:
>
> #include <stdio.h>
> #include <stdlib.h>
> int main(void){
> printf("sizeof(long double)==%d\n", (int) sizeof(long double));
> return 0;
> }
>
> prints: sizeof(long double)==12
>
> is this really true?
>
> Thomas
You are basically right. On the other hand, variables
are aligned to 4-Byte boundaries in gcc, hence it
take 12 bytes, where the last two bytes are unused.
Other machines may require packing to 8 or 16 byte
boundaries, so things are not always the way they
seem ;-)
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* Voice/Fax Box: +49 2561 91371 2056 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -