Embedded Artistry Framework
Embedded Systems C++ Framework
Macros
rounded_div.h File Reference
This graph shows which files directly or indirectly include this file:

Macros

#define ROUNDED_DIV(A, B)   (((A) + ((B) / 2)) / (B))
 Macro for performing rounded integer division (as opposed to truncating the result). More...
 

Macro Definition Documentation

◆ ROUNDED_DIV

#define ROUNDED_DIV (   A,
  B 
)    (((A) + ((B) / 2)) / (B))

Macro for performing rounded integer division (as opposed to truncating the result).

Parameters
[in]ANumerator.
[in]BDenominator.
Returns
Rounded (integer) result of dividing A by B.