round - /* Yields X rounded down to the nearest multiple of...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#ifndef __LIB_ROUND_H #define __LIB_ROUND_H /* Yields X rounded up to the nearest multiple of STEP. For X >= 0, STEP >= 1 only. */ #define ROUND_UP(X, STEP) (((X) + (STEP) - 1) / (STEP) * (STEP)) /* Yields X divided by STEP, rounded up. For X >= 0, STEP >= 1 only. */ #define DIV_ROUND_UP(X, STEP) (((X) + (STEP) - 1) / (STEP))
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: /* Yields X rounded down to the nearest multiple of STEP. For X >= 0, STEP >= 1 only. */ #define ROUND_DOWN(X, STEP) ((X) / (STEP) * (STEP)) /* There is no DIV_ROUND_DOWN. It would be simply X / STEP. */ #endif /* lib/round.h */...
View Full Document

This note was uploaded on 02/19/2010 for the course EE 142 taught by Professor John during the Spring '04 term at Abraham Baldwin Agricultural College.

Ask a homework question - tutors are online