ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/02/23:30:14

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Jack Klein <jackklein AT spamcop DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Types double , float
Message-ID: <un0laukvr6idv276egpuuffka1kvdd4eic@4ax.com>
References: <hGmq8.109980$1S3 DOT 3510722 AT twister1 DOT libero DOT it>
X-Newsreader: Forte Agent 1.9/32.560
MIME-Version: 1.0
Lines: 31
Date: Wed, 03 Apr 2002 04:20:16 GMT
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc05-news.ops.worldnet.att.net 1017807616 (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" <usrinfousr AT libero DOT it>
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

- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019