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.

45 lines
744 B

  1. /***
  2. *frnd.c -
  3. *
  4. * Copyright (c) 1991-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *
  8. *
  9. *Revision History:
  10. *
  11. * 10-20-91 GDP written
  12. * 09-05-94 SKS Change #ifdef i386 to #ifdef _M_IX86
  13. */
  14. /***
  15. *double _frnd(double x) - round to integer
  16. *
  17. *Purpose:
  18. * Round to integer according to the current rounding mode.
  19. * NaN's or infinities are NOT handled
  20. *
  21. *Entry:
  22. *
  23. *Exit:
  24. *
  25. *Exceptions:
  26. *******************************************************************************/
  27. double _frnd(double x)
  28. {
  29. double result;
  30. #if defined _M_IX86 || defined _X86SEG_
  31. _asm {
  32. fld x
  33. frndint
  34. fstp result
  35. }
  36. #else
  37. #error Only 386 platform supported
  38. #endif
  39. return result;
  40. }