home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s038 / 10.ddi / 017.LIF / FLOAT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-07-02  |  5.9 KB  |  145 lines

  1. /* float.h - 8087 control function prototypes
  2.  * $Version: 1.2 $
  3.  * Copyright (c) 1988-91 Intel Corporation, ALL RIGHTS RESERVED.
  4.  */
  5.  
  6. #ifndef _floath
  7. #define _floath
  8. /*lint -library */
  9.  
  10. #define DBL_DIG          15  /* maximum decimal digits of double precision */
  11. #define DBL_EPSILON     2.2204460492503131e-16
  12. #define DBL_MANT_DIG     53
  13. #define DBL_MAX         1.7976931348623157e+308
  14. #define DBL_MAX_10_EXP     308
  15. #define DBL_MAX_EXP      1024
  16. #define DBL_MIN         2.2250738585072014e-308
  17. #define DBL_MIN_10_EXP   (-307)
  18. #define DBL_MIN_EXP     (-1021)
  19. #define DBL_RADIX        2             /* Radix of the floating-point number */
  20.                                        /* e.g., a binary machine             */
  21. #define DBL_ROUNDS       1
  22.  
  23. #define FLT_DIG          6   /* maximum decimal digits of float precision */
  24. #define FLT_EPSILON     1.19209290e-7F
  25. #define FLT_MANT_DIG     24
  26. #define FLT_MAX         3.40282347e+38F
  27. #define FLT_MAX_10_EXP     38
  28. #define FLT_MAX_EXP      128
  29. #define FLT_MIN         1.17549435e-38F
  30. #define FLT_MIN_10_EXP   (-37)
  31. #define FLT_MIN_EXP     (-125)
  32. #define FLT_RADIX        2   /* radix of the floating point number */
  33.                              /* e.g. a binary machine  */
  34. #define FLT_ROUNDS       1   /* 1 == round to nearest */
  35.  
  36.  
  37. /*****************************************************************************
  38. **  These values are full IEEE/ANSI defined, but are not supported under iC386.
  39. **  Since Long Double is not supported under iC386, these values will be 
  40. **  defined as the same as DBL, above.
  41. ******************************************************************************/
  42. #if 0
  43. #define LDBL_DIG         18  /* max decimal digits of long double precisn */
  44. #define LDBL_EPSILON     1.08420217248550443401e-19L
  45. #define LDBL_MANT_DIG    64
  46. #define LDBL_MAX     1.18973149535723176502e+4932L
  47. #define LDBL_MAX_10_EXP     4932
  48. #define LDBL_MAX_EXP     16384
  49. #define LDBL_MIN     3.36210314311209350626e-4932L /* relatively close */
  50. #define LDBL_MIN_10_EXP  (-4931)
  51. #define LDBL_MIN_EXP     (-16381)
  52. #define LDBL_RADIX       2             /* Radix of the floating-point number */
  53.                                        /* e.g., a binary machine             */
  54. #define LDBL_ROUNDS      1
  55.  
  56.  
  57. #else
  58.  
  59. #define LDBL_DIG         DBL_DIG
  60. #define LDBL_EPSILON     DBL_EPSILON
  61. #define LDBL_MANT_DIG    DBL_MANT_DIG
  62. #define LDBL_MAX     DBL_MAX
  63. #define LDBL_MAX_10_EXP     DBL_MAX_10_EXP
  64. #define LDBL_MAX_EXP     DBL_MAX_EXP
  65. #define LDBL_MIN     DBL_MIN
  66. #define LDBL_MIN_10_EXP  DBL_MIN_10_EXP
  67. #define LDBL_MIN_EXP     DBL_MIN_EXP
  68. #define LDBL_RADIX       2             /* Radix of the floating-point number */
  69.                                        /* e.g., a binary machine             */
  70. #define LDBL_ROUNDS      1
  71.  
  72.  
  73. #endif
  74.  
  75. /*
  76.  * Numeric coprocessor configuration constants:
  77.  */
  78. #define MCW_EM              0x003f      /* Interrupt Exception Masks         */
  79. #define EM_INVALID          0x0001      /*   Invalid                         */
  80. #define EM_DENORMAL         0x0002      /*   Denormal                        */
  81. #define EM_ZERODIVIDE       0x0004      /*   Zero divide                     */
  82. #define EM_OVERFLOW         0x0008      /*   Overflow                        */
  83. #define EM_UNDERFLOW        0x0010      /*   Underflow                       */
  84. #define EM_INEXACT          0x0020      /*   Inexact (precision)             */
  85.  
  86. #define MCW_IC              0x1000      /* Infinity Control                  */
  87. #define IC_AFFINE           0x1000      /*   Affine                          */
  88. #define IC_PROJECTIVE       0x0000      /*   Projective                      */
  89.  
  90. #define MCW_RC              0x0c00      /* Rounding Control                  */
  91. #define RC_CHOP             0x0c00      /*   Chop                            */
  92. #define RC_UP               0x0800      /*   Up                              */
  93. #define RC_DOWN             0x0400      /*   Down                            */
  94. #define RC_NEAR             0x0000      /*   Near                            */
  95.  
  96. #define MCW_PC              0x0300      /* Precision Control                 */
  97. #define PC_24               0x0000      /*    24 bits                        */
  98. #define PC_53               0x0200      /*    53 bits                        */
  99. #define PC_64               0x0300      /*    64 bits                        */
  100.  
  101. #define CW_DEFAULT  (IC_AFFINE + RC_NEAR + PC_64 + EM_INVALID + EM_DENORMAL + \
  102.                      EM_ZERODIVIDE + EM_OVERFLOW + EM_UNDERFLOW + EM_INEXACT)
  103.  
  104. /*
  105.  * User status word:
  106.  */
  107. #define SW_INVALID          0x0001      /* Invalid                           */
  108. #define SW_DENORMAL         0x0002      /* Denormal                          */
  109. #define SW_ZERODIVIDE       0x0004      /* Zero divide                       */
  110. #define SW_OVERFLOW         0x0008      /* Overflow                          */
  111. #define SW_UNDERFLOW        0x0010      /* Underflow                         */
  112. #define SW_INEXACT          0x0020      /* Inexact (precision)               */
  113. #define SW_UNEMULATED       0x0040      /* Unemulated instruction            */
  114. #define SW_SQRTNEG          0x0080      /* Square root of a neg number       */
  115. #define SW_STACKOVERFLOW    0x0200      /* Floating-point stack overflow     */
  116. #define SW_STACKUNDERFLOW   0x0400      /* Floating-point stack underflow    */
  117.  
  118. /*
  119.  * Floating-point error signals and return codes:
  120.  */
  121. #define FPE_INVALID         0x81
  122. #define FPE_DENORMAL        0x82
  123. #define FPE_ZERODIVIDE      0x83
  124. #define FPE_OVERFLOW        0x84
  125. #define FPE_UNDERFLOW       0x85
  126. #define FPE_INEXACT         0x86
  127. #define FPE_UNEMULATED      0x87
  128. #define FPE_SQRTNEG         0x88
  129. #define FPE_STACKOVERFLOW   0x8a
  130. #define FPE_STACKUNDERFLOW  0x8b
  131.  
  132. #define FPE_EXPLICITGEN     0x8c                         /* Raise( SIGFPE ); */
  133.  
  134. /*
  135.  * Function prototypes:
  136.  */
  137.  
  138. #ifndef _87_functions
  139. #define _87_functions
  140. unsigned int _control87(unsigned int, unsigned int);
  141. void         _fpreset(void);
  142. #endif
  143.  
  144. #endif /* _floath */
  145.