Rounds a given integer to the nearest multiple of 10.
This function takes an integer value, validates it, and rounds it to the nearest multiple of 10. Negative values are not allowed and will throw an exception.
- Parameters
-
value | The integer value to be rounded. |
- Returns
- int The value rounded to the nearest multiple of 10.
- Exceptions
-
std::invalid_argument | If the input value is negative. |
- Note
- Example usage:
int round_to_nearest_multiple_of_power_of_10(int value)
Rounds a given integer to the nearest multiple of 10.
Definition indexVector.cpp:28