home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / qc25 / include / math.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-07-25  |  7.9 KB  |  239 lines

  1. /***
  2. *math.h - Definitionen und Deklarationen für Arithmetik-Bibliothek
  3. *
  4. *    Copyright (c) 1985-1990, Microsoft Corporation.  Alle Rechte vorbehalten.
  5. *
  6. * Zweck:
  7. *    Hier sind die Konstantendefinitionen und die externen
  8. *    Nebenroutinen-Deklarationen für die Arithmetik-Bibliothek zu finden.
  9. *    [ANSI/System V]
  10. *
  11. ***/
  12.  
  13. #if defined(_DLL) && !defined(_MT)
  14. #error _DLL kann ohne  _MT nicht definiert werden
  15. #endif
  16.  
  17. #ifdef _MT
  18. #define _FAR_ _far
  19. #else
  20. #define _FAR_
  21. #endif
  22.  
  23.  
  24. /* Definition der Struktur exception - die an matherr übergeben wird,
  25.  * wenn eine Gleitkomma-Ausnahme entdeckt wurde 
  26.  */
  27.  
  28. #ifndef _EXCEPTION_DEFINED
  29. struct exception {
  30.     int type;        /* Ausnahmetyp - siehe unten */
  31.     char _FAR_ *name;    /* Name der Funktion, wo Fehler auftrat */
  32.     double arg1;        /* Erstes Argument zur Funktion */
  33.     double arg2;        /* Zweites Argument zur Funktion */
  34.     double retval;        /* Rückgabewert der Funktion */
  35.     } ;
  36. #define _EXCEPTION_DEFINED
  37. #endif
  38.  
  39.  
  40. /* Definition einer komplexen Struktur; wird dann benutzt, wenn 'cabs'
  41.  * verwendet werden und in Argumenten Typenprüfung durchgeführt werden soll.
  42.  */
  43.  
  44. #ifndef _COMPLEX_DEFINED
  45. struct complex {
  46.     double x,y;    /* Real- und Imaginärteile */
  47.     } ;
  48. #define _COMPLEX_DEFINED
  49. #endif
  50.  
  51.  
  52. /* Konstantendefinitionen für den in der Struktur exception übergebenen 
  53.  *        Ausnahmetyp. 
  54.  */
  55.  
  56. #define DOMAIN        1    /* Fehler: Argumentbereich */
  57. #define SING        2    /* Argument-Singularität */
  58. #define OVERFLOW    3    /* Überlauf-Bereichsfehler */
  59. #define UNDERFLOW    4    /* Unterlauf-Bereichsfehler */
  60. #define TLOSS        5    /* Vollkommener Präzisionsverlust */
  61. #define PLOSS        6    /* Teilweiser Präzisionsverlust */
  62.  
  63. #define EDOM        33
  64. #define ERANGE        34
  65.  
  66.  
  67. /* Definitionen von HUGE und HUGE_VAL - dies sind die XENIX- bzw. ANSI-Namen
  68.  * für einen Ergebniswert, wenn einige der Gleitkomma-Arithmetikroutinen einen 
  69.  * Fehler produzieren
  70.  */
  71.  
  72. #ifndef _DLL
  73. extern double _near _cdecl HUGE;
  74. #define HUGE_VAL HUGE
  75.  
  76. #else    /* _DLL */
  77. extern double _FAR_ _cdecl HUGE;
  78. #define HUGE_VAL HUGE
  79.  
  80. #endif    /* _DLL */
  81.  
  82.  
  83. /* Funktionsprototypen */
  84.  
  85. #ifdef    _MT     /* Funktionsprototypen für _MT Version */
  86. int    _FAR_ _cdecl  abs(int);
  87. double    _FAR_ _pascal acos(double);
  88. double    _FAR_ _pascal asin(double);
  89. double    _FAR_ _pascal atan(double);
  90. double    _FAR_ _pascal atan2(double, double);
  91. double    _FAR_ _pascal atof(const char _FAR_ *);
  92. double    _FAR_ _pascal cabs(struct complex);
  93. double    _FAR_ _pascal ceil(double);
  94. double    _FAR_ _pascal cos(double);
  95. double    _FAR_ _pascal cosh(double);
  96. int    _FAR_ _cdecl  dieeetomsbin(double _FAR_ *, double _FAR_ *);
  97. int    _FAR_ _cdecl  dmsbintoieee(double _FAR_ *, double _FAR_ *);
  98. double    _FAR_ _pascal exp(double);
  99. double    _FAR_ _pascal fabs(double);
  100. int    _FAR_ _cdecl  fieeetomsbin(float _FAR_ *, float _FAR_ *);
  101. double    _FAR_ _pascal floor(double);
  102. double    _FAR_ _pascal fmod(double, double);
  103. int    _FAR_ _cdecl  fmsbintoieee(float _FAR_ *, float _FAR_ *);
  104. double    _FAR_ _pascal frexp(double, int _FAR_ *);
  105. double    _FAR_ _pascal hypot(double, double);
  106. double    _FAR_ _pascal j0(double);
  107. double    _FAR_ _pascal j1(double);
  108. double    _FAR_ _pascal jn(int, double);
  109. long    _FAR_ _cdecl  labs(long);
  110. double    _FAR_ _pascal ldexp(double, int);
  111. double    _FAR_ _pascal log(double);
  112. double    _FAR_ _pascal log10(double);
  113. int    _FAR_ _cdecl  matherr(struct exception _FAR_ *);
  114. double    _FAR_ _pascal modf(double, double _FAR_ *);
  115. double    _FAR_ _pascal pow(double, double);
  116. double    _FAR_ _pascal sin(double);
  117. double    _FAR_ _pascal sinh(double);
  118. double    _FAR_ _pascal sqrt(double);
  119. double    _FAR_ _pascal tan(double);
  120. double    _FAR_ _pascal tanh(double);
  121. double    _FAR_ _pascal y0(double);
  122. double    _FAR_ _pascal y1(double);
  123. double    _FAR_ _pascal yn(int, double);
  124.  
  125. #else        /* Funktionsprototypen für nicht _MT Version */
  126. int    _FAR_ _cdecl abs(int);
  127. double    _FAR_ _cdecl acos(double);
  128. double    _FAR_ _cdecl asin(double);
  129. double    _FAR_ _cdecl atan(double);
  130. double    _FAR_ _cdecl atan2(double, double);
  131. double    _FAR_ _cdecl atof(const char _FAR_ *);
  132. double    _FAR_ _cdecl cabs(struct complex);
  133. double    _FAR_ _cdecl ceil(double);
  134. double    _FAR_ _cdecl cos(double);
  135. double    _FAR_ _cdecl cosh(double);
  136. int    _FAR_ _cdecl dieeetomsbin(double _FAR_ *, double _FAR_ *);
  137. int    _FAR_ _cdecl dmsbintoieee(double _FAR_ *, double _FAR_ *);
  138. double    _FAR_ _cdecl exp(double);
  139. double    _FAR_ _cdecl fabs(double);
  140. int    _FAR_ _cdecl fieeetomsbin(float _FAR_ *, float _FAR_ *);
  141. double    _FAR_ _cdecl floor(double);
  142. double    _FAR_ _cdecl fmod(double, double);
  143. int    _FAR_ _cdecl fmsbintoieee(float _FAR_ *, float _FAR_ *);
  144. double    _FAR_ _cdecl frexp(double, int _FAR_ *);
  145. double    _FAR_ _cdecl hypot(double, double);
  146. double    _FAR_ _cdecl j0(double);
  147. double    _FAR_ _cdecl j1(double);
  148. double    _FAR_ _cdecl jn(int, double);
  149. long    _FAR_ _cdecl labs(long);
  150. double    _FAR_ _cdecl ldexp(double, int);
  151. double    _FAR_ _cdecl log(double);
  152. double    _FAR_ _cdecl log10(double);
  153. int    _FAR_ _cdecl matherr(struct exception _FAR_ *);
  154. double    _FAR_ _cdecl modf(double, double _FAR_ *);
  155. double    _FAR_ _cdecl pow(double, double);
  156. double    _FAR_ _cdecl sin(double);
  157. double    _FAR_ _cdecl sinh(double);
  158. double    _FAR_ _cdecl sqrt(double);
  159. double    _FAR_ _cdecl tan(double);
  160. double    _FAR_ _cdecl tanh(double);
  161. double    _FAR_ _cdecl y0(double);
  162. double    _FAR_ _cdecl y1(double);
  163. double    _FAR_ _cdecl yn(int, double);
  164. #endif
  165.  
  166.  
  167. /* Definition der Struktur _exceptionl  - diese Strutkur wird an die Funktion 
  168.  * _matherrl übergeben, wenn eine Gleitkomma Exception in einer 
  169.  * long double Funktion festgestellt wird.
  170.  */
  171.  
  172. #ifndef _LD_EXCEPTION_DEFINED
  173. struct _exceptionl {
  174.     int type;        /* Exception Typ - siehe unten */
  175.     char _FAR_ *name;    /* Name der Funktion, in der Fehler aufgetreten ist */
  176.     long double arg1;    /* erstes Argument an Funktion */
  177.     long double arg2;    /* zwietes Argument (sofern vorhanden) an Function */
  178.     long double retval;    /* Rückgabewert von Funktion*/
  179.     } ;
  180. #define _LD_EXCEPTION_DEFINED
  181. #endif
  182.  
  183.  
  184. /* Definition einer Struktur _complexl- zu verwenden, falls Sie die
  185.  * Funktion _cabsl benutzen und gleichzeitig Typenüberprüfung der Argumente
  186.  * durchführen wollen
  187.  */
  188.  
  189. #ifndef _LD_COMPLEX_DEFINED
  190. struct _complexl {
  191.     long double x,y;    /* Real- und Imaginärteil */
  192.     } ;
  193. #define _LD_COMPLEX_DEFINED
  194. #endif
  195.  
  196.  
  197. #ifndef _DLL
  198. extern long double _near _cdecl _LHUGE;
  199. #define _LHUGE_VAL _LHUGE
  200.  
  201. #else    /* _DLL */
  202. extern long double _FAR_ _cdecl _LHUGE;
  203. #define _LHUGE_VAL _LHUGE
  204.  
  205. #endif    /* _DLL */
  206.  
  207. long double  _FAR_ _cdecl acosl(long double);
  208. long double  _FAR_ _cdecl asinl(long double);
  209. long double  _FAR_ _cdecl atanl(long double);
  210. long double  _FAR_ _cdecl atan2l(long double, long double);
  211. long double  _FAR_ _cdecl _atold(const char _FAR_ *);
  212. long double  _FAR_ _cdecl cabsl(struct _complexl);
  213. long double  _FAR_ _cdecl ceill(long double);
  214. long double  _FAR_ _cdecl cosl(long double);
  215. long double  _FAR_ _cdecl coshl(long double);
  216. long double  _FAR_ _cdecl expl(long double);
  217. long double  _FAR_ _cdecl fabsl(long double);
  218. long double  _FAR_ _cdecl floorl(long double);
  219. long double  _FAR_ _cdecl fmodl(long double, long double);
  220. long double  _FAR_ _cdecl frexpl(long double, int _FAR_ *);
  221. long double  _FAR_ _cdecl hypotl(long double, long double);
  222. long double  _FAR_ _cdecl _j0l(long double);
  223. long double  _FAR_ _cdecl _j1l(long double);
  224. long double  _FAR_ _cdecl _jnl(int, long double);
  225. long double  _FAR_ _cdecl ldexpl(long double, int);
  226. long double  _FAR_ _cdecl logl(long double);
  227. long double  _FAR_ _cdecl log10l(long double);
  228. int         _FAR_ _cdecl _matherrl(struct _exceptionl _FAR_ *);
  229. long double  _FAR_ _cdecl modfl(long double, long double _FAR_ *);
  230. long double  _FAR_ _cdecl powl(long double, long double);
  231. long double  _FAR_ _cdecl sinl(long double);
  232. long double  _FAR_ _cdecl sinhl(long double);
  233. long double  _FAR_ _cdecl sqrtl(long double);
  234. long double  _FAR_ _cdecl tanl(long double);
  235. long double  _FAR_ _cdecl tanhl(long double);
  236. long double  _FAR_ _cdecl _y0l(long double);
  237. long double  _FAR_ _cdecl _y1l(long double);
  238. long double  _FAR_ _cdecl _ynl(int, long double);
  239.