float.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #ifndef __FLOAT
  2. #define __FLOAT
  3. /* IEEE, default rounding */
  4. #define FLT_ROUNDS 1
  5. #define FLT_RADIX 2
  6. #define FLT_DIG 6
  7. #define FLT_EPSILON 1.19209290e-07
  8. #define FLT_MANT_DIG 24
  9. #define FLT_MAX 3.40282347e+38
  10. #define FLT_MAX_10_EXP 38
  11. #define FLT_MAX_EXP 128
  12. #define FLT_MIN 1.17549435e-38
  13. #define FLT_MIN_10_EXP -37
  14. #define FLT_MIN_EXP -125
  15. #define DBL_DIG 15
  16. #define DBL_EPSILON 2.2204460492503131e-16
  17. #define DBL_MANT_DIG 53
  18. #define DBL_MAX 1.797693134862315708145e+308
  19. #define DBL_MAX_10_EXP 308
  20. #define DBL_MAX_EXP 1024
  21. #define DBL_MIN 2.225073858507201383090233e-308
  22. #define DBL_MIN_10_EXP -307
  23. #define DBL_MIN_EXP -1021
  24. #define LDBL_MANT_DIG DBL_MANT_DIG
  25. #define LDBL_EPSILON DBL_EPSILON
  26. #define LDBL_DIG DBL_DIG
  27. #define LDBL_MIN_EXP DBL_MIN_EXP
  28. #define LDBL_MIN DBL_MIN
  29. #define LDBL_MIN_10_EXP DBL_MIN_10_EXP
  30. #define LDBL_MAX_EXP DBL_MAX_EXP
  31. #define LDBL_MAX DBL_MAX
  32. #define LDBL_MAX_10_EXP DBL_MAX_10_EXP
  33. typedef union FPdbleword FPdbleword;
  34. union FPdbleword
  35. {
  36. double x;
  37. struct { /* big endian */
  38. long hi;
  39. long lo;
  40. };
  41. };
  42. #ifdef _RESEARCH_SOURCE
  43. /* define order of longs in IEEE double: little endian */
  44. #define IEEE_MC68k 1
  45. #define Sudden_Underflow 1
  46. #endif
  47. #ifdef _PLAN9_SOURCE
  48. /* FCR */
  49. #define FPINEX (3<<8)
  50. #define FPOVFL (1<<12)
  51. #define FPUNFL (1<<11)
  52. #define FPZDIV (1<<10)
  53. #define FPRNR (0<<4)
  54. #define FPRZ (1<<4)
  55. #define FPRPINF (3<<4)
  56. #define FPRNINF (2<<4)
  57. #define FPRMASK (3<<4)
  58. #define FPPEXT (0<<6)
  59. #define FPPSGL (1<<6)
  60. #define FPPDBL (2<<6)
  61. #define FPPMASK (3<<6)
  62. /* FSR */
  63. #define FPAINEX FPINEX
  64. #define FPAOVFL FPOVFL
  65. #define FPAUNFL FPUNFL
  66. #define FPAZDIV FPZDIV
  67. #endif
  68. #endif /* __FLOAT */