Article View: comp.std.c
Article #3341Re: understanding FLT_DIG
From: 51351[efw]-Robert Feddeler(MT479...
Date: Thu, 07 Jan 1993 21:51
Date: Thu, 07 Jan 1993 21:51
23 lines
1284 bytes
1284 bytes
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.
Technical Details
Message-ID:
<1993Jan7.215114.12680@lincroftnj.ncr.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!dptg!rjfReferences:
<steve.726275211@unidata.ucar.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!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