d_nint.c 281 B

1234567891011121314151617181920
  1. #include "f2c.h"
  2. #ifdef KR_headers
  3. double floor();
  4. double d_nint(x) doublereal *x;
  5. #else
  6. #undef abs
  7. #include "math.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. double d_nint(doublereal *x)
  12. #endif
  13. {
  14. return( (*x)>=0 ?
  15. floor(*x + .5) : -floor(.5 - *x) );
  16. }
  17. #ifdef __cplusplus
  18. }
  19. #endif