home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c083 / 14.ddi / GENINC.PAK / FLOAT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-02  |  5.3 KB  |  161 lines

  1. /*  float.h
  2.  
  3.     Defines implementation specific macros for dealing with
  4.     floating point.
  5.  
  6. */
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 6.0
  10.  *
  11.  *      Copyright (c) 1987, 1993 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15.  
  16. #ifndef __FLOAT_H
  17. #define __FLOAT_H
  18.  
  19. #if !defined( ___DEFS_H )
  20. #include <_defs.h>
  21. #endif
  22.  
  23. #define FLT_RADIX           2
  24. #define FLT_ROUNDS          1
  25. #define FLT_GUARD           1
  26. #define FLT_NORMALIZE       1
  27.  
  28. #define DBL_DIG             15
  29. #define FLT_DIG             7
  30. #define LDBL_DIG            19
  31.  
  32. #define DBL_MANT_DIG        53
  33. #define FLT_MANT_DIG        24
  34. #define LDBL_MANT_DIG       64
  35.  
  36. #define DBL_EPSILON         2.2204460492503131E-16
  37. #define FLT_EPSILON         1.19209290E-07F
  38. #define LDBL_EPSILON        1.084202172485504E-19L
  39.  
  40. /* smallest positive IEEE normal numbers */
  41. #define DBL_MIN             2.2250738585072014E-308
  42. #define FLT_MIN             1.17549435E-38F
  43. #define LDBL_MIN            _tiny_ldble
  44.  
  45. #define DBL_MAX             _huge_dble
  46. #define FLT_MAX             _huge_flt
  47. #define LDBL_MAX            _huge_ldble
  48.  
  49. #define DBL_MAX_EXP         +1024
  50. #define FLT_MAX_EXP         +128
  51. #define LDBL_MAX_EXP        +16384
  52.  
  53. #define DBL_MAX_10_EXP      +308
  54. #define FLT_MAX_10_EXP      +38
  55. #define LDBL_MAX_10_EXP     +4932
  56.  
  57. #define DBL_MIN_10_EXP      -307
  58. #define FLT_MIN_10_EXP      -37
  59. #define LDBL_MIN_10_EXP     -4931
  60.  
  61. #define DBL_MIN_EXP         -1021
  62. #define FLT_MIN_EXP         -125
  63. #define LDBL_MIN_EXP        -16381
  64.  
  65. extern float        _RTLENTRY _EXPDATA _huge_flt;
  66. extern double       _RTLENTRY _EXPDATA _huge_dble;
  67. extern long double  _RTLENTRY _EXPDATA _huge_ldble;
  68. extern long double  _RTLENTRY _EXPDATA _tiny_ldble;
  69.  
  70. #ifdef __cplusplus
  71. extern "C" {
  72. #endif
  73. unsigned int _RTLENTRY _EXPFUNC _clear87(void);
  74. unsigned int _RTLENTRY _EXPFUNC _control87(unsigned int __newcw, unsigned int __mask);
  75. void         _RTLENTRY _EXPFUNC _fpreset(void);
  76. unsigned int _RTLENTRY _EXPFUNC _status87(void);
  77. #ifdef __cplusplus
  78. }
  79. #endif
  80.  
  81. #if !__STDC__
  82.  
  83. /* 387 Status Word format   */
  84.  
  85. #define SW_INVALID      0x0001  /* Invalid operation            */
  86. #define SW_DENORMAL     0x0002  /* Denormalized operand         */
  87. #define SW_ZERODIVIDE   0x0004  /* Zero divide                  */
  88. #define SW_OVERFLOW     0x0008  /* Overflow                     */
  89. #define SW_UNDERFLOW    0x0010  /* Underflow                    */
  90. #define SW_INEXACT      0x0020  /* Precision (Inexact result)   */
  91. #define SW_STACKFAULT   0x0040  /* Stack fault                  */
  92.  
  93. /* 387 Control Word format */
  94.  
  95. #define MCW_EM              0x003f  /* interrupt Exception Masks*/
  96. #define     EM_INVALID      0x0001  /*   invalid                */
  97. #define     EM_DENORMAL     0x0002  /*   denormal               */
  98. #define     EM_ZERODIVIDE   0x0004  /*   zero divide            */
  99. #define     EM_OVERFLOW     0x0008  /*   overflow               */
  100. #define     EM_UNDERFLOW    0x0010  /*   underflow              */
  101. #define     EM_INEXACT      0x0020  /*   inexact (precision)    */
  102.  
  103. #define MCW_IC              0x1000  /* Infinity Control */
  104. #define     IC_AFFINE       0x1000  /*   affine         */
  105. #define     IC_PROJECTIVE   0x0000  /*   projective     */
  106.  
  107. #define MCW_RC          0x0c00  /* Rounding Control     */
  108. #define     RC_CHOP     0x0c00  /*   chop               */
  109. #define     RC_UP       0x0800  /*   up                 */
  110. #define     RC_DOWN     0x0400  /*   down               */
  111. #define     RC_NEAR     0x0000  /*   near               */
  112.  
  113. #define MCW_PC          0x0300  /* Precision Control    */
  114. #define     PC_24       0x0000  /*    24 bits           */
  115. #define     PC_53       0x0200  /*    53 bits           */
  116. #define     PC_64       0x0300  /*    64 bits           */
  117.  
  118. /* 387 Initial Control Word */
  119. /* use affine infinity, mask underflow and precision exceptions */
  120.  
  121. #define CW_DEFAULT  _default87
  122. extern unsigned int _RTLENTRY _default87;
  123.  
  124. /*
  125.     SIGFPE signal error types (for integer & float exceptions).
  126. */
  127. #define FPE_INTOVFLOW       126 /* 80x86 Interrupt on overflow  */
  128. #define FPE_INTDIV0         127 /* 80x86 Integer divide by zero */
  129.  
  130. #define FPE_INVALID         129 /* 80x87 invalid operation      */
  131. #define FPE_ZERODIVIDE      131 /* 80x87 divide by zero         */
  132. #define FPE_OVERFLOW        132 /* 80x87 arithmetic overflow    */
  133. #define FPE_UNDERFLOW       133 /* 80x87 arithmetic underflow   */
  134. #define FPE_INEXACT         134 /* 80x87 precision loss         */
  135. #define FPE_STACKFAULT      135 /* 80x87 stack overflow         */
  136. #define FPE_EXPLICITGEN     140 /* When SIGFPE is raise()'d     */
  137.  
  138. /*
  139.             SIGSEGV signal error types.
  140. */
  141. #define SEGV_BOUND          10  /* A BOUND violation (SIGSEGV)  */
  142. #define SEGV_EXPLICITGEN    11  /* When SIGSEGV is raise()'d    */
  143. #if defined(__OS2__) || defined(__WIN32__)
  144. #define SEGV_ACCESS         12  /* Access violation */
  145. #define SEGV_STACK          13  /* Unable to grow stack */
  146. #endif
  147.  
  148. /*
  149.             SIGILL signal error types.
  150. */
  151. #define ILL_EXECUTION       20  /* Illegal operation exception  */
  152. #define ILL_EXPLICITGEN     21  /* When SIGILL is raise()'d     */
  153. #if defined(__OS2__) || defined(__WIN32__)
  154. #define ILL_PRIVILEGED      22  /* Privileged instruction */
  155. #endif
  156.  
  157. #endif  /* !__STDC__ */
  158.  
  159. #endif  /* __FLOAT_H */
  160.  
  161.