math.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:6k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* math.h - math routines */
  2. /* Copyright 1989-1995 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01o,08jul96,ms   fixed prototype for fmodf (SPR 6856)
  7. 01n,29mar95,kdl  added prototype for __fixunssfsi() (gcc callout routine).
  8. 01m,15oct92,rrr  silenced warnings
  9. 01l,22sep92,rrr  added support for c++
  10. 01k,19sep92,kdl  added prototypes for gccMathInit, gccUssInit, gccUss040Init.
  11. 01j,30jul92,kdl  changed to ANSI single precision names (e.g. fsin -> sinf);
  12.  merged various architectures; fixed 01i mod history.
  13. 01i,08jul92,smb  merged with ANSI math.h
  14. 01h,04jul92,jcf  cleaned up.
  15. 01g,26may92,rrr  the tree shuffle
  16. 01f,04oct91,rrr  passed through the ansification filter
  17.   -fixed #else and #endif
  18.   -changed copyright notice
  19. 01e,16jul91,ajm  added MIPS specific externs, and made MIPS unsupported
  20.  functions 68k dependent
  21. 01d,28jan91,kdl  added single-precision, cbrt(), hypot(); changed def's of
  22.  irint() and iround() to int; changed def of sincos() to void.
  23. 01c,19oct90,elr  ANSI cleaned up
  24. 01b,05oct90,dnw  deleted private routines.
  25. 01a,23aug90,elr  written.
  26. */
  27. #ifndef __INCmathh
  28. #define __INCmathh
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. #include "types/vxANSI.h"
  33. /* ANSI-compatible definitions */
  34. #define HUGE_VAL        _ARCH_HUGH_VAL
  35. #if defined(__STDC__) || defined(__cplusplus)
  36. /* ANSI-compatible functions */
  37. extern double  acos (double x);
  38. extern double  asin (double x);
  39. extern double  atan (double x);
  40. extern double  atan2 (double y, double x);
  41. extern double  ceil (double x);
  42. extern double  cos (double x);
  43. extern double  cosh (double x);
  44. extern double  exp (double x);
  45. extern double  fabs (double x);
  46. extern double  floor (double x);
  47. extern double  fmod (double x, double y);
  48. extern double  frexp (double x, int *exponent);
  49. extern double  ldexp (double x, int __exp);
  50. extern double  log (double x);
  51. extern double  log10 (double x);
  52. extern double  modf (double x, double *pIntResult);
  53. extern double  pow (double x, double y);
  54. extern double  sin (double x);
  55. extern double  sinh (double x);
  56. extern double  sqrt (double x);
  57. extern double  tan (double x);
  58. extern double  tanh (double x);
  59. /* Single-precision versions of ANSI functions    *
  60.  *    Not available on all VxWorks architectures. */
  61. extern float  acosf (float x);
  62. extern float  asinf (float x);
  63. extern float  atanf (float x);
  64. extern float  atan2f (float x, float y);
  65. extern float  ceilf (float x);
  66. extern float  cosf (float x);
  67. extern float  coshf (float x);
  68. extern float  expf (float x);
  69. extern float  fabsf (float x);
  70. extern float  floorf (float x);
  71. extern float  fmodf (float x, float y);
  72. extern float  logf (float x);
  73. extern float  log10f (float x);
  74. extern float  powf (float x, float y);
  75. extern float  sinf (float x);
  76. extern float  sinhf (float x);
  77. extern float  sqrtf (float x);
  78. extern float  tanf (float x);
  79. extern float  tanhf (float x);
  80. /* Miscellaneous math functions                   *
  81.  *    Not available on all VxWorks architectures. */
  82. extern double  cbrt (double x);
  83. extern double  hypot (double x, double y);
  84. extern double  infinity (void);
  85. extern int  irint (double x);
  86. extern int  iround (double x);
  87. extern double  log2 (double x);
  88. extern double  rint (double x);
  89. extern double  round (double x);
  90. extern void  sincos (double x, double *pSinResult, double *pCosResult);
  91. extern double  trunc (double x);
  92. extern float  cbrtf (float x);
  93. extern float  hypotf (float x, float y);
  94. extern float  infinityf (void);
  95. extern int  irintf (float x);
  96. extern int  iroundf (float x);
  97. extern float  log2f (float x);
  98. extern float  roundf (float x);
  99. extern void  sincosf (float x, float *pSinResult, float *pCosResult);
  100. extern float  truncf (float x);
  101. /* VxWorks math library calls */
  102. extern void  floatInit (void);
  103. extern void  mathHardInit (void);
  104. extern void  mathSoftInit (void);
  105. extern void gccMathInit (void);
  106. extern void gccUssInit (void);
  107. extern void gccUss040Init (void);
  108. extern unsigned __fixunssfsi (long a);
  109. #else /* !__STDC__ */
  110. /* ANSI-compatible functions */
  111. extern double  acos ();
  112. extern double  asin ();
  113. extern double  atan ();
  114. extern double  atan2 ();
  115. extern double  ceil ();
  116. extern double  cos ();
  117. extern double  cosh ();
  118. extern double  exp ();
  119. extern double  fabs ();
  120. extern double  floor ();
  121. extern double  fmod ();
  122. extern double  frexp ();
  123. extern double  ldexp ();
  124. extern double  log ();
  125. extern double  log10 ();
  126. extern double  modf ();
  127. extern double  pow ();
  128. extern double  sin ();
  129. extern double  sinh ();
  130. extern double  sqrt ();
  131. extern double  tan ();
  132. extern double  tanh ();
  133. /* Single-precision versions of ANSI functions    *
  134.  *    Not available on all VxWorks architectures. */
  135. extern float  acosf ();
  136. extern float  asinf ();
  137. extern float  atanf ();
  138. extern float  atan2f ();
  139. extern float  ceilf ();
  140. extern float  cosf ();
  141. extern float  coshf ();
  142. extern float  expf ();
  143. extern float  fabsf ();
  144. extern float  floorf ();
  145. extern float  fmodf ();
  146. extern float  logf ();
  147. extern float  log10f ();
  148. extern float  powf ();
  149. extern float  sinf ();
  150. extern float  sinhf ();
  151. extern float  sqrtf ();
  152. extern float  tanf ();
  153. extern float  tanhf ();
  154. /* Miscellaneous math functions                   *
  155.  *    Not available on all VxWorks architectures. */
  156. extern double  cbrt ();
  157. extern double  hypot ();
  158. extern double  infinity ();
  159. extern int  irint ();
  160. extern int  iround ();
  161. extern double  log2 ();
  162. extern double  rint ();
  163. extern double  round ();
  164. extern void  sincos ();
  165. extern double  trunc ();
  166. extern float  cbrtf ();
  167. extern float  hypotf ();
  168. extern float  infinityf ();
  169. extern int  irintf ();
  170. extern int  iroundf ();
  171. extern float  log2f ();
  172. extern float  roundf ();
  173. extern void  sincosf ();
  174. extern float  truncf ();
  175. /* VxWorks math library calls */
  176. extern void  floatInit ();
  177. extern void  mathHardInit ();
  178. extern void  mathSoftInit ();
  179. extern void gccMathInit ();
  180. extern void gccUssInit ();
  181. extern void gccUss040Init ();
  182. extern unsigned __fixunssfsi();
  183. #endif /* __STDC__ */
  184. #ifdef __cplusplus
  185. }
  186. #endif
  187. #endif /* __INCmathh */