gsl_sys__prec.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* sys/prec.c
  2. *
  3. * Copyright (C) 1996, 1997, 1998, 1999, 2000, 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. /* Author: G. Jungman */
  20. #include "gsl__config.h"
  21. #include "gsl_machine.h"
  22. #include "gsl_precision.h"
  23. const double gsl_prec_eps[_GSL_PREC_T_NUM] = {
  24. GSL_DBL_EPSILON,
  25. GSL_FLT_EPSILON,
  26. GSL_SFLT_EPSILON
  27. };
  28. const double gsl_prec_sqrt_eps[_GSL_PREC_T_NUM] = {
  29. GSL_SQRT_DBL_EPSILON,
  30. GSL_SQRT_FLT_EPSILON,
  31. GSL_SQRT_SFLT_EPSILON
  32. };
  33. const double gsl_prec_root3_eps[_GSL_PREC_T_NUM] = {
  34. GSL_ROOT3_DBL_EPSILON,
  35. GSL_ROOT3_FLT_EPSILON,
  36. GSL_ROOT3_SFLT_EPSILON
  37. };
  38. const double gsl_prec_root4_eps[_GSL_PREC_T_NUM] = {
  39. GSL_ROOT4_DBL_EPSILON,
  40. GSL_ROOT4_FLT_EPSILON,
  41. GSL_ROOT4_SFLT_EPSILON
  42. };
  43. const double gsl_prec_root5_eps[_GSL_PREC_T_NUM] = {
  44. GSL_ROOT5_DBL_EPSILON,
  45. GSL_ROOT5_FLT_EPSILON,
  46. GSL_ROOT5_SFLT_EPSILON
  47. };
  48. const double gsl_prec_root6_eps[_GSL_PREC_T_NUM] = {
  49. GSL_ROOT6_DBL_EPSILON,
  50. GSL_ROOT6_FLT_EPSILON,
  51. GSL_ROOT6_SFLT_EPSILON
  52. };
  53. typedef unsigned int gsl_mode_t;
  54. #ifndef HIDE_INLINE_STATIC
  55. /* We need this somewhere, in case the inline is ignored.
  56. */
  57. unsigned int GSL_MODE_PREC(gsl_mode_t mt);
  58. unsigned int
  59. GSL_MODE_PREC(gsl_mode_t mt)
  60. {
  61. return (mt & (unsigned int)7);
  62. }
  63. #endif