X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f From: Jack Klein Newsgroups: comp.os.msdos.djgpp Subject: Re: Types double , float Message-ID: References: X-Newsreader: Forte Agent 1.9/32.560 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 31 Date: Wed, 03 Apr 2002 04:20:16 GMT NNTP-Posting-Host: 12.84.3.50 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1017807616 12.84.3.50 (Wed, 03 Apr 2002 04:20:16 GMT) NNTP-Posting-Date: Wed, 03 Apr 2002 04:20:16 GMT Organization: AT&T Worldnet To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 2 Apr 2002 20:20:39 +0200, "infonews" wrote in comp.os.msdos.djgpp: > I'm learning C. I cannot find where are written the rules of coding > of data in double or float types. > int n = 5 -----> in memory is 0500 , OK. > double n = 5 ------> 0000000000001440 ????? > float n = 5 --------->0000A040 ???? > Anybody is so kind to solve this my puzzle ? > Thanks in advance. Actually the C language does not specify how floating point values are stored, and it is not something that anyone writing portable, standard C code really needs to know. Actually the floating point format is different for different processor hardware. DJGPP uses the formats that Intel has defined for their hardware floating point unit. You can go to http://developer.intel.com and download the data books for various Intel processors which will tell you the definition of this format. If you were using a C compiler for a different processor family, such as a 68000, PowerPC, Sparc, and so on, the format would be different. -- Jack Klein Home: http://JK-Technology.Com FAQs for comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html comp.lang.c++ http://www.parashift.com/c++-faq-lite/ alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq