Advertisement
Guest User

Untitled

a guest
Jul 10th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.61 KB | None | 0 0
  1. #ifndef _MATH_H_
  2. #define _MATH_H_
  3.  
  4. #define HUGE_VAL (__DBL_MAX__ * 2.0)
  5.  
  6. /*
  7.  *   prototypes for the standard C maths functions.  
  8.  */
  9.  
  10. #if (__DBL_MANT_DIG__ != __FLT_MANT_DIG__)
  11. double acos(double);
  12. double asin(double);
  13. double atan(double);
  14. double atan2(double, double);
  15. double cos(double);
  16. double sin(double);
  17. double tan(double);
  18. double cosh(double);
  19. double sinh(double);
  20. double tanh(double);
  21. double exp(double);
  22. double frexp(double, int *);
  23. double ldexp(double, int);
  24. double log(double);
  25. double log10(double);
  26. double modf(double, double *);
  27. double pow(double, double);
  28. double sqrt(double);
  29. double ceil(double);
  30. double fabs(double);
  31. double floor(double);
  32. double fmod(double, double);
  33. #endif
  34.  
  35. /*
  36.  *   prototypes for the float maths functions.
  37.  */
  38. float acosf(float);
  39. float asinf(float);
  40. float atanf(float);
  41. float atan2f(float, float);
  42. float cosf(float);
  43. float sinf(float);
  44. float tanf(float);
  45. float coshf(float);
  46. float sinhf(float);
  47. float tanhf(float);
  48. float expf(float);
  49. float frexpf(float, int *);
  50. float ldexpf(float, int);
  51. float logf(float);
  52. float log10f(float);
  53. #if (__DBL_MANT_DIG__ == __FLT_MANT_DIG__)
  54. /*
  55.  *  Without -fno-short-double, float * and double * are compatable, but a
  56.  *  warning can still be produced.
  57.  */
  58. float modff(float, void *);
  59. #else
  60. float modff(float, float *);
  61. #endif
  62. float powf(float, float);
  63. float sqrtf(float);
  64. float ceilf(float);
  65. float fabsf(float);
  66. float floorf(float);
  67. float fmodf(float, float);
  68.  
  69. /*
  70.  *    prototypes for long double maths functions.  On dsPIC30, long double
  71.  *      is always 64bits regardless of the setting of the -fno-short-double
  72.  *      and -fshort-double options.
  73.  */
  74. long double acosl(long double);
  75. long double asinl(long double);
  76. long double atanl(long double);
  77. long double atan2l(long double, long double);
  78. long double cosl(long double);
  79. long double sinl(long double);
  80. long double tanl(long double);
  81. long double coshl(long double);
  82. long double sinhl(long double);
  83. long double tanhl(long double);
  84. long double expl(long double);
  85. long double frexpl(long double, int *);
  86. long double ldexpl(long double, int);
  87. long double logl(long double);
  88. long double log10l(long double);
  89. long double modfl(long double, long double *);
  90. long double powl(long double, long double);
  91. long double sqrtl(long double);
  92. long double ceill(long double);
  93. long double fabsl(long double);
  94. long double floorl(long double);
  95. long double fmodl(long double, long double);
  96.  
  97. /*
  98.  *   macro definitions to ensure that the default functions are correct
  99.  *     for the chosen size of double:  see -fno-short-double and -fshort-double
  100.  */
  101.  
  102. #if (__DBL_MANT_DIG__ == __FLT_MANT_DIG__)
  103. #define __MPROTO(x)  x ## f
  104. #else
  105. #define __MPROTO(x)  x
  106. #endif
  107.  
  108.  
  109. #define acos __MPROTO(acos)
  110. #define asin __MPROTO(asin)
  111. #define atan __MPROTO(atan)
  112. #define atan2 __MPROTO(atan2)
  113. #define cos __MPROTO(cos)
  114. #define sin __MPROTO(sin)
  115. #define tan __MPROTO(tan)
  116. #define cosh __MPROTO(cosh)
  117. #define sinh __MPROTO(sinh)
  118. #define tanh __MPROTO(tanh)
  119. #define exp __MPROTO(exp)
  120. #define frexp __MPROTO(frexp)
  121. #define ldexp __MPROTO(ldexp)
  122. #define log __MPROTO(log)
  123. #define log10 __MPROTO(log10)
  124. #define modf __MPROTO(modf)
  125. #define pow __MPROTO(pow)
  126. #define sqrt __MPROTO(sqrt)
  127. #define ceil __MPROTO(ceil)
  128. #define fabs __MPROTO(fabs)
  129. #define floor __MPROTO(floor)
  130. #define fmod __MPROTO(fmod)
  131.  
  132. /*
  133.  *  Prototypes for non-standard maths functions; these are part of libm
  134.  *    and will be satisfied by libm-<omf>.a which is automatically included
  135.  *    by the compiler.
  136.  */
  137.  
  138. unsigned long __udiv3216(unsigned long, unsigned int);
  139.          long __div3216(long, int);
  140.  
  141. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement