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

  1. /* math.h - math and trig definitions
  2.  * $Version: 1.1 $
  3.  * Copyright (c) 1984,85,86,87 Computer Innovations Inc, ALL RIGHTS RESERVED.
  4.  * Copyright (c) 1988,89, 90 Intel Corporation, ALL RIGHTS RESERVED.
  5.  */
  6.  
  7. #ifndef _mathh
  8. #define _mathh
  9. /*lint -library */
  10.  
  11. #pragma fixedparams("acos",  "asin",  "atan",  "atan2",   "ceil")
  12. #pragma fixedparams("cos",   "cosh",  "exp",   "fabs",    "floor")
  13. #pragma fixedparams("fmod",  "frexp", "j0",    "j1",      "jn")
  14. #pragma fixedparams("ldexp", "log",   "log10", "matherr", "modf")
  15. #pragma fixedparams("pow",   "sin",   "sinh",  "sqrt",    "square")
  16. #pragma fixedparams("tan",   "tanh",  "y0",    "y1",      "yn")
  17.  
  18.  
  19. #ifndef HUGE_VAL
  20. #define HUGE_VAL    1.7976931348623157e+308   /* DBL_MAX */
  21. #endif
  22.  
  23. /*
  24.  * Exception types for matherr():
  25.  */
  26. #define DOMAIN      1                   /* Argument domain error     */
  27. #define SING        2                   /* Singularity error         */
  28. #define OVERFLOW    3                   /* Function overflow error   */
  29. #define UNDERFLOW   4                   /* Function underflow error  */
  30. #define TLOSS       5                   /* Total loss of precision   */
  31. #define PLOSS       6                   /* Partial loss of precision */
  32.  
  33. /*
  34.  * Function prototypes:
  35.  */
  36. double acos(double);
  37. double asin(double);
  38. double atan(double);
  39. double atan2(double, double);
  40. double cos(double);
  41. double sin(double);
  42. double tan(double);
  43. double cosh(double);
  44. double sinh(double);
  45. double tanh(double);
  46. double exp(double);
  47. double frexp(double, int *);
  48. double ldexp(double, int);
  49. double log(double);
  50. double log10(double);
  51. double modf(double, double *);
  52. double pow(double, double);
  53. double sqrt(double);
  54. double ceil(double);
  55. double fabs(double);
  56. double floor(double);
  57. double fmod(double, double);
  58.  
  59. /* non-ANSI declarations */
  60. #pragma align (exception)
  61. struct exception {
  62.     int    type;
  63.     char  *name;
  64.     double arg1;
  65.     double arg2;
  66.     double retval;
  67. };
  68.  
  69. #pragma align (complex)
  70. struct complex {
  71.     double x;
  72.     double y;
  73. };
  74.  
  75. double j0(double);
  76. double j1(double);
  77. double jn(int, double);
  78. int    matherr(struct exception *);    /* this is just a stub */
  79. double square(double);
  80. double y0(double);
  81. double y1(double);
  82. double yn(int, double);
  83.  
  84.  
  85. /*
  86.  *  Compiler built-in functions:
  87.  */
  88. #ifndef _mathh_builtin
  89. #define _mathh_builtin
  90.  
  91. #pragma _builtin_("_fabs_"==53)
  92. double _fabs_(double);
  93. #define fabs(x) _fabs_(x)
  94.  
  95. #pragma _builtin_("_sqrt_"==54)
  96. double _sqrt_(double);
  97. #define sqrt(x) _sqrt_(x)
  98.  
  99. #if _ARCHITECTURE_ == 386 ||  _ARCHITECTURE_ == 486
  100.  
  101. /* The following builtins are only valid in a 387/486 environment */
  102.  
  103. #pragma _builtin_("_log_"==55)
  104. double _log_(double);
  105. #define log(x) _log_(x)
  106.  
  107. #pragma _builtin_("_log10_"==56)
  108. double _log10_(double);
  109. #define log10(x) _log10_(x)
  110.  
  111. #pragma _builtin_("_cos_"==57)
  112. double _cos_(double);
  113. #define cos(x) _cos_(x)
  114.  
  115. #pragma _builtin_("_sin_"==58)
  116. double _sin_(double);
  117. #define sin(x) _sin_(x)
  118.  
  119. #pragma _builtin_("_tan_"==59)
  120. double _tan_(double);
  121. #define tan(x) _tan_(x)
  122.  
  123. #pragma _builtin_("_acos_"==60)
  124. double _acos_(double);
  125. #define acos(x) _acos_(x)
  126.  
  127. #pragma _builtin_("_asin_"==61)
  128. double _asin_(double);
  129. #define asin(x) _asin_(x)
  130.  
  131. #pragma _builtin_("_atan2_"==62)
  132. double _atan2_(double,double);
  133. #define atan2(x,y) _atan2_(x,y)
  134.  
  135. #pragma _builtin_("_atan_"==63)
  136. double _atan_(double);
  137. #define atan(x) _atan_(x)
  138.  
  139. #endif /* _ARCHITECTURE_  */
  140.  
  141. #endif /* _mathh_builtin */
  142.  
  143. #endif /* _mathh */
  144.