From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: sizeof(long double) Date: Thu, 06 Mar 1997 12:13:01 +0100 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 41 Message-ID: <331EA6BD.15FB@LSTM.Ruhr-UNI-Bochum.De> References: NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp 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 > #include > 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 * *************************************************************