home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / LIBC / LIBC-4.6 / LIBC-4 / libc-linux / sysdeps / linux / i386 / math / fp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-30  |  2.4 KB  |  102 lines

  1. /* Copyright (C) 1993  Olaf Flebbe
  2.  
  3. EXPERIMENTAL IMPLEMENTATION OF proposals of the NCEG
  4.  
  5. */
  6.  
  7. #ifndef _FP_H
  8. #define _FP_H
  9.  
  10. #define float_t long double
  11. #define double_t long double
  12.  
  13. #define HUGE_VALL INFINITYL
  14.  
  15. #define FP_NAN       1
  16. #define FP_INFINITE  2
  17. #define FP_NORMAL    3
  18. #define FP_SUBNORMAL 4
  19. #define FP_ZERO      5
  20.  
  21. #define fpclassify(x) ((sizeof(x) == sizeof(float)) ? fpclassifyf(x) \
  22.     : (sizeof(x) == sizeof(double)) ? fpclassifyd(x) \
  23.     : fpclassifyl(x))
  24.  
  25. #define signbit(x) ( x < 0 ? 1 : 0)
  26.  
  27. #define isfinite( x) ( int ___x = fpclassify( x); \
  28.                        !( ___x==FP_NAN || ___x==FP_INFINITE))
  29. #define isnormal(x)  (fpclassify( x) == FP_NORMAL)
  30. #define isnanl(x)     (fpclassifyl( x) == FP_NAN)
  31. #define isinfl(x)     (fpclassifyl( x) == FP_INFINITE)
  32.  
  33. #define DECIMAL_DIGIT 19
  34.  
  35.  
  36. long double acoshl( long double _x);
  37. long double acosl ( long double _x);
  38. long double asinhl ( long double _x);
  39. long double asinl ( long double _x);
  40. long double atanl ( long double _x);
  41. long double atan2l( long double _x, long double _y);
  42. long double atanhl( long double _x);
  43. long double fabsl ( long double _x);
  44. long double floorl( long double _x);
  45. long double fmodl ( long double _x, long double _y);
  46. long double hypotl( long double _x, long double _y);
  47. long double sqrtl ( long double _x);
  48. long double sinl  ( long double _x);
  49. long double logl  ( long double _x);
  50. long double expl  ( long double _x); 
  51.  
  52. int fpclassifyf( float _x);
  53. int fpclassifyd( double _x);
  54. int fpclassifyl( long double _x);
  55.  
  56. #ifndef M_E
  57. #define M_E         2.7182818284590452354l
  58. #endif
  59. #ifndef M_LOG2E
  60. #define M_LOG2E     1.4426950408889634074l
  61. #endif
  62. #ifndef M_LOG10E
  63. #define M_LOG10E    0.43429448190325182765l
  64. #endif
  65. #ifndef M_LN2
  66. #define M_LN2       0.69314718055994530942l
  67. #endif
  68. #ifndef M_LN10
  69. #define M_LN10      2.30258509299404568402l
  70. #endif
  71. #ifndef M_PI
  72. #define M_PI        3.14159265358979323846l
  73. #endif
  74. #ifndef M_PI_2
  75. #define M_PI_2      1.57079632679489661923l
  76. #endif
  77. #ifndef M_1_PI
  78. #define M_1_PI      0.31830988618379067154l
  79. #endif
  80. #ifndef M_PI_4
  81. #define M_PI_4      0.78539816339744830962l
  82. #endif
  83. #ifndef M_2_PI
  84. #define M_2_PI      0.63661977236758134308l
  85. #endif
  86. #ifndef M_2_SQRTPI
  87. #define M_2_SQRTPI  1.12837916709551257390l
  88. #endif
  89. #ifndef M_SQRT2
  90. #define M_SQRT2     1.41421356237309504880l
  91. #endif
  92. #ifndef M_SQRT1_2
  93. #define M_SQRT1_2   0.70710678118654752440l
  94. #endif
  95.  
  96. /* private definition */
  97. long double __infnanl( int error);
  98.  
  99.  
  100. #endif
  101.  
  102.