Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
887 B

  1. /* _Feraise function */
  2. #include <errno.h>
  3. #if _IS_C9X
  4. #include <fenv.h>
  5. #include <math.h>
  6. #else /* _IS_C9X */
  7. #include <ymath.h>
  8. #endif /* _IS_C9X */
  9. _STD_BEGIN
  10. void (_Feraise)(int except)
  11. { /* report floating-point exception */
  12. #if _IS_C9X
  13. if (math_errhandling == MATH_ERREXCEPT)
  14. feraiseexcept(except);
  15. if (math_errhandling != MATH_ERRNO)
  16. ;
  17. else if ((except & (_FE_DIVBYZERO | _FE_INVALID)) != 0)
  18. errno = EDOM;
  19. else if ((except & (_FE_UNDERFLOW | _FE_OVERFLOW)) != 0)
  20. errno = ERANGE;
  21. #else /* _IS_C9X */
  22. if ((except & (_FE_DIVBYZERO | _FE_INVALID)) != 0)
  23. errno = EDOM;
  24. else if ((except & (_FE_UNDERFLOW | _FE_OVERFLOW)) != 0)
  25. errno = ERANGE;
  26. #endif /* _IS_C9X */
  27. }
  28. _STD_END
  29. /*
  30. * Copyright (c) 1992-2001 by P.J. Plauger. ALL RIGHTS RESERVED.
  31. * Consult your license regarding permissions and restrictions.
  32. V3.10:0009 */