rnd.h 506 B

1234567891011121314151617
  1. /*
  2. * Copyright 1996, University Corporation for Atmospheric Research
  3. * See netcdf/COPYRIGHT file for copying and redistribution conditions.
  4. */
  5. /* $Id: rnd.h,v 2.13 1996/12/11 05:46:54 davis Exp $ */
  6. #ifndef _RNDUP
  7. /* useful for aligning memory */
  8. #define _RNDUP(x, unit) ((((x) + (unit) - 1) / (unit)) \
  9. * (unit))
  10. #define _RNDDOWN(x, unit) ((x) - ((x)%(unit)))
  11. #define M_RND_UNIT (sizeof(double))
  12. #define M_RNDUP(x) _RNDUP(x, M_RND_UNIT)
  13. #define M_RNDDOWN(x) __RNDDOWN(x, M_RND_UNIT)
  14. #endif