gsl_pow_int.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* gsl_pow_int.h
  2. *
  3. * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004, 2007 Gerard Jungman, Brian Gough
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef __GSL_POW_INT_H__
  20. #define __GSL_POW_INT_H__
  21. #undef __BEGIN_DECLS
  22. #undef __END_DECLS
  23. #ifdef __cplusplus
  24. # define __BEGIN_DECLS extern "C" {
  25. # define __END_DECLS }
  26. #else
  27. # define __BEGIN_DECLS /* empty */
  28. # define __END_DECLS /* empty */
  29. #endif
  30. __BEGIN_DECLS
  31. #ifdef HAVE_INLINE
  32. extern inline double gsl_pow_2(const double x);
  33. extern inline double gsl_pow_3(const double x);
  34. extern inline double gsl_pow_4(const double x);
  35. extern inline double gsl_pow_5(const double x);
  36. extern inline double gsl_pow_6(const double x);
  37. extern inline double gsl_pow_7(const double x);
  38. extern inline double gsl_pow_8(const double x);
  39. extern inline double gsl_pow_9(const double x);
  40. extern inline double gsl_pow_2(const double x) { return x*x; }
  41. extern inline double gsl_pow_3(const double x) { return x*x*x; }
  42. extern inline double gsl_pow_4(const double x) { double x2 = x*x; return x2*x2; }
  43. extern inline double gsl_pow_5(const double x) { double x2 = x*x; return x2*x2*x; }
  44. extern inline double gsl_pow_6(const double x) { double x2 = x*x; return x2*x2*x2; }
  45. extern inline double gsl_pow_7(const double x) { double x3 = x*x*x; return x3*x3*x; }
  46. extern inline double gsl_pow_8(const double x) { double x2 = x*x; double x4 = x2*x2; return x4*x4; }
  47. extern inline double gsl_pow_9(const double x) { double x3 = x*x*x; return x3*x3*x3; }
  48. #else
  49. double gsl_pow_2(const double x);
  50. double gsl_pow_3(const double x);
  51. double gsl_pow_4(const double x);
  52. double gsl_pow_5(const double x);
  53. double gsl_pow_6(const double x);
  54. double gsl_pow_7(const double x);
  55. double gsl_pow_8(const double x);
  56. double gsl_pow_9(const double x);
  57. #endif
  58. double gsl_pow_int(double x, int n);
  59. __END_DECLS
  60. #endif /* __GSL_POW_INT_H__ */