home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / SASC6574.LZX / include / float.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-04  |  3.9 KB  |  117 lines

  1. /* Copyright (c) 1992-1993 SAS Institute, Inc., Cary, NC USA */
  2. /* All Rights Reserved */
  3.  
  4.  
  5. #ifndef _FLOAT_H
  6. #define _FLOAT_H 1
  7.  
  8. /**
  9. *
  10. * The following symbols are specified in the ANSI C standard for the
  11. * floating point number system.
  12. *
  13. **/
  14.  
  15. #define FLT_RADIX 2        /* radix of exponent             */
  16. #define FLT_ROUNDS 1        /* rounding mode during translation    */
  17.                 /*   0 => chop                */
  18.                 /*   1 => round                */
  19.                 /*   2 => indeterminate            */
  20. #define FLT_GUARD 0        /* guard digits during multiplication     */
  21.                 /*   0 => No                */
  22.                 /*   1 => Yes                */
  23. #define FLT_NORMALIZE 1        /* normalization required        */
  24.                 /*   0 => No                */
  25.                 /*   1 => Yes                */
  26.  
  27. #ifndef _FFP
  28. /* These are for IEEE Floating Point */
  29. #define FLT_MANT_DIG     24     /* # radix digits in float mantissa     */
  30. #define DBL_MANT_DIG     53     /* # radix digits in double mantissa    */
  31. #define LDBL_MANT_DIG    53     /* # radix digits in long double mant.  */
  32.  
  33. #define FLT_DIG      6          /* max decimal digits for float         */
  34. #define DBL_DIG      15         /* max decimal digits for double        */
  35. #define LDBL_DIG     15         /* max decimal digits for long double   */
  36.  
  37. #define FLT_MIN_EXP   -125    /* min radix exponent for float            */
  38. #define DBL_MIN_EXP   -1021    /* min radix exponent for double    */
  39. #define LDBL_MIN_EXP  -1021      /* min radix exponent for long double   */
  40.  
  41. #define FLT_MIN_10_EXP   -37
  42. #define DBL_MIN_10_EXP   -307
  43. #define LDBL_MIN_10_EXP  -307
  44.  
  45. #define FLT_MAX_EXP  128     /* max radix exponent for float     */
  46. #define DBL_MAX_EXP  1024    /* max radix exponent for double    */
  47. #define LDBL_MAX_EXP 1024       /* max radix exponent for double long   */
  48.  
  49. #define FLT_MAX_10_EXP   38     /* max decimal exponent for float       */
  50. #define DBL_MAX_10_EXP   308    /* max decimal exponent for double      */
  51. #define LDBL_MAX_10_EXP  308    /* max decimal exponent for long double */
  52.  
  53. #define FLT_MAX  ((float)3.40282347E+38)
  54. #define DBL_MAX       1.7976931348623157E+308
  55. #define LDBL_MAX DBL_MAX
  56.  
  57. #define FLT_EPSILON   ((float)1.19209290E-07)
  58. #define DBL_EPSILON   2.2204460492503131E-16
  59. #define LDBL_EPSILON  DBL_EPSILON
  60.  
  61. #define FLT_MIN       ((float)1.17549435E-38)
  62. #define DBL_MIN       2.2250738585072014E-308
  63.  
  64. #define LDBL_MIN      DBL_MIN
  65.  
  66. #else
  67. /* These are for Fast Floating Point */
  68. #define FLT_MANT_DIG     24     /* # radix digits in float mantissa     */
  69. #define DBL_MANT_DIG     24     /* # radix digits in double mantissa    */
  70. #define LDBL_MANT_DIG    24     /* # radix digits in long double mant.  */
  71.  
  72. #define FLT_DIG      7          /* max decimal digits for float         */
  73. #define DBL_DIG      7          /* max decimal digits for double        */
  74. #define LDBL_DIG     7          /* max decimal digits for long double   */
  75.  
  76. #define FLT_MIN_EXP   -63    /* min radix exponent for float            */
  77. #define DBL_MIN_EXP   -63    /* min radix exponent for double    */
  78. #define LDBL_MIN_EXP  -63  /* min radix exponent for long double   */
  79.  
  80. #define FLT_MIN_10_EXP   -20
  81. #define DBL_MIN_10_EXP   -20
  82. #define LDBL_MIN_10_EXP  -20
  83.  
  84. #define FLT_MAX_EXP  63     /* max radix exponent for float     */
  85. #define DBL_MAX_EXP  63      /* max radix exponent for double    */
  86. #define LDBL_MAX_EXP 63    /* max radix exponent for double long   */
  87.  
  88. #define FLT_MAX_10_EXP   18     /* max decimal exponent for float       */
  89. #define DBL_MAX_10_EXP   18     /* max decimal exponent for double      */
  90. #define LDBL_MAX_10_EXP  18     /* max decimal exponent for long double */
  91.  
  92. #define FLT_MAX  9.22337176E+18
  93. #define DBL_MAX  FLT_MAX
  94. #define LDBL_MAX DBL_MAX
  95.  
  96. #define FLT_EPSILON   1.19209290E-07
  97. #define DBL_EPSILON   FLT_EPSILON
  98. #define LDBL_EPSILON  DBL_EPSILON
  99.  
  100. #define FLT_MIN       5.42101087E-20
  101. #define DBL_MIN       FLT_MIN
  102.  
  103. #define LDBL_MIN      DBL_MIN
  104. #endif
  105.  
  106. #ifndef _STRICT_ANSI
  107.  
  108. /* The proper place for the following definition     */
  109. /* is in <math.h>, but put it here for compatibility */
  110. #ifndef _COMMHUGE_H
  111. #include <sys/commhuge.h>
  112. #endif
  113.  
  114. #endif  /* _STRICT_ANSI */
  115.  
  116. #endif
  117.