home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / c / 3324 < prev    next >
Encoding:
Text File  |  1993-01-06  |  999 b   |  31 lines

  1. Newsgroups: comp.std.c
  2. Path: sparky!uunet!europa.asd.contel.com!gatech!asuvax!ncar!steve
  3. From: steve@unidata.ucar.edu (Steve Emmerson)
  4. Subject: understanding FLT_DIG
  5. Message-ID: <steve.726275211@unidata.ucar.edu>
  6. Sender: news@ncar.ucar.edu (USENET Maintenance)
  7. Organization: University Corporation for Atmospheric Research (UCAR)
  8. Distribution: na
  9. Date: Tue, 5 Jan 1993 23:06:51 GMT
  10. Lines: 19
  11.  
  12. Hi,
  13.  
  14. I'm having trouble understanding FLT_DIG, which is defined in <float.h>,
  15. According to section 2.2.4.2.2 of the ANSI standard, FLT_DIG is given by
  16. the following on base-2 machines:
  17.  
  18.     FLT_DIG = (int)((p-1)*log10(2))
  19.  
  20. where `p' is the precision (the number of base-2 digits in the
  21. significand).
  22.  
  23. On a hypothetical base-2 machine with 4 bits of precision, the above yields
  24. 0 for FLT_DIG.  Yet, those 4 bits can represent the integral values 1
  25. through 9 exactly.  Thus, shouldn't FLT_DIG be 1?
  26.  
  27. Eagerly awaiting enlightenment.
  28. --
  29.  
  30. Steve Emmerson        steve@unidata.ucar.edu        ...!ncar!unidata!steve
  31.