home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!rjf
- From: rjf@lincroftnj.ncr.com (51351[efw]-Robert Feddeler(MT4799)T343)
- Subject: Re: understanding FLT_DIG
- Message-ID: <1993Jan7.215114.12680@lincroftnj.ncr.com>
- Organization: AT&T/NCR, Lincroft, NJ, USA
- References: <steve.726275211@unidata.ucar.edu>
- Distribution: na
- Date: Thu, 7 Jan 1993 21:51:14 GMT
- Lines: 23
-
- In article <steve.726275211@unidata.ucar.edu> steve@unidata.ucar.edu (Steve Emmerson) writes:
- >Hi,
- >
- >I'm having trouble understanding FLT_DIG, which is defined in <float.h>,
- >According to section 2.2.4.2.2 of the ANSI standard, FLT_DIG is given by
- >the following on base-2 machines:
- >
- > FLT_DIG = (int)((p-1)*log10(2))
- >
- >where `p' is the precision (the number of base-2 digits in the
- >significand).
- >
- >On a hypothetical base-2 machine with 4 bits of precision, the above yields
- >0 for FLT_DIG. Yet, those 4 bits can represent the integral values 1
- >through 9 exactly. Thus, shouldn't FLT_DIG be 1?
- >
-
- Note the 'p-1'. The '-1' leaves room for a sign bit.
- You're left with only 3 bits or 0-7.
-
-
- bob. | Heap bit trouble in the land of plenty.
- Were these more than just my opinions, they would have cost a bit more.
-