Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

my_math.h File Reference

Go to the source code of this file.

Functions

unsigned int round_to_multiple_of (unsigned int value, unsigned int factor)
 Given two integers N and p, the function returns the integer r such as:
  • r is a multiple of p.
  • "r = N + x" with x such as "0 <= x < N"
For example, if N=2 and p=4, then r=4.



Detailed Description

Header file for my_math.c

Definition in file my_math.h.


Function Documentation

unsigned int round_to_multiple_of unsigned int    value,
unsigned int    factor
 

Given two integers N and p, the function returns the integer r such as:

  • r is a multiple of p.
  • "r = N + x" with x such as "0 <= x < N"
For example, if N=2 and p=4, then r=4.

Parameters:
value This parameter matches N in the function's description above.
factor This parameter matches p in the function's description above.
Returns:
The function returns the multiple of factor, that is closest to value (greater that value).

Definition at line 18 of file my_math.c.


Generated on Thu Apr 3 16:23:46 2003 for Common_C_libraries by doxygen1.3-rc1