maths: add divide-and-round-up

This commit is contained in:
Danny Robson 2014-04-16 19:17:15 +10:00
parent 16b81f2a07
commit b26449fd5f

View File

@ -60,6 +60,12 @@ unsigned
digits (const T& value) pure;
template <typename T>
T
divup (const T a, const T b)
{ return (a + b - 1) / a; }
/**
* Check if two floating point numbers are approximately equal. Returns true
* if the difference is less than a percentage of each individual value.