fenv.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright (C) 2012-2019 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library. If not, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _FENV_H
  15. # error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
  16. #endif
  17. /* The Altera specified Nios II hardware FPU does not support exceptions,
  18. nor does the software floating-point support. */
  19. #define FE_ALL_EXCEPT 0
  20. /* Nios II supports only round-to-nearest. The software
  21. floating-point support also acts this way. */
  22. enum
  23. {
  24. __FE_UNDEFINED = 0,
  25. FE_TONEAREST =
  26. #define FE_TONEAREST 1
  27. FE_TONEAREST,
  28. };
  29. /* Type representing exception flags. */
  30. typedef unsigned int fexcept_t;
  31. /* Type representing floating-point environment. */
  32. typedef unsigned int fenv_t;
  33. /* If the default argument is used we use this value. */
  34. #define FE_DFL_ENV ((const fenv_t *) -1)
  35. #if __GLIBC_USE (IEC_60559_BFP_EXT)
  36. /* Type representing floating-point control modes. */
  37. typedef unsigned int femode_t;
  38. /* Default floating-point control modes. */
  39. # define FE_DFL_MODE ((const femode_t *) -1L)
  40. #endif