Integer Rounding Functions
- License
- Botan is released under the Simplified BSD License (see LICENSE.md)
Round up
- Parameters
T n |
an integer |
T align_to |
the alignment boundary |
- Returns
- n rounded up to a multiple of align_to
Round down
- Parameters
T n |
an integer |
T align_to |
the alignment boundary |
- Returns
- n rounded down to a multiple of align_to
size_t clamp(size_t n, size_t lower_bound, size_t upper_bound);