float.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef _FLOAT_H_
  2. #define _FLOAT_H_
  3. #define FLT_RADIX 2
  4. /* IEEE float */
  5. #define FLT_MANT_DIG 24
  6. #define FLT_DIG 6
  7. #define FLT_ROUNDS 1
  8. #define FLT_EPSILON 1.19209290e-07F
  9. #define FLT_MIN_EXP (-125)
  10. #define FLT_MIN 1.17549435e-38F
  11. #define FLT_MIN_10_EXP (-37)
  12. #define FLT_MAX_EXP 128
  13. #define FLT_MAX 3.40282347e+38F
  14. #define FLT_MAX_10_EXP 38
  15. /* IEEE double */
  16. #define DBL_MANT_DIG 53
  17. #define DBL_DIG 15
  18. #define DBL_EPSILON 2.2204460492503131e-16
  19. #define DBL_MIN_EXP (-1021)
  20. #define DBL_MIN 2.2250738585072014e-308
  21. #define DBL_MIN_10_EXP (-307)
  22. #define DBL_MAX_EXP 1024
  23. #define DBL_MAX 1.7976931348623157e+308
  24. #define DBL_MAX_10_EXP 308
  25. /* horrible intel long double */
  26. #ifdef __i386__
  27. #define LDBL_MANT_DIG 64
  28. #define LDBL_DIG 18
  29. #define LDBL_EPSILON 1.08420217248550443401e-19L
  30. #define LDBL_MIN_EXP (-16381)
  31. #define LDBL_MIN 3.36210314311209350626e-4932L
  32. #define LDBL_MIN_10_EXP (-4931)
  33. #define LDBL_MAX_EXP 16384
  34. #define LDBL_MAX 1.18973149535723176502e+4932L
  35. #define LDBL_MAX_10_EXP 4932
  36. #else
  37. /* same as IEEE double */
  38. #define LDBL_MANT_DIG 53
  39. #define LDBL_DIG 15
  40. #define LDBL_EPSILON 2.2204460492503131e-16
  41. #define LDBL_MIN_EXP (-1021)
  42. #define LDBL_MIN 2.2250738585072014e-308
  43. #define LDBL_MIN_10_EXP (-307)
  44. #define LDBL_MAX_EXP 1024
  45. #define LDBL_MAX 1.7976931348623157e+308
  46. #define LDBL_MAX_10_EXP 308
  47. #endif
  48. #endif /* _FLOAT_H_ */