Skip to content

Commit

Permalink
🎨 Added noexcept to math_utils functions
Browse files Browse the repository at this point in the history
  • Loading branch information
wlambooy committed Jun 2, 2023
1 parent 9c43ca7 commit d5ba024
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/fiction/utils/math_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace fiction
* @return The number rounded to n decimal places.
*/
template <typename T>
T round_to_n_decimal_places(const T number, const uint64_t n)
T round_to_n_decimal_places(const T number, const uint64_t n) noexcept
{
static_assert(std::is_arithmetic_v<T>, "T is not a number type");
const T factor = std::pow(10, n);
Expand All @@ -37,7 +37,7 @@ T round_to_n_decimal_places(const T number, const uint64_t n)
* @return |n|.
*/
template <typename T>
T integral_abs(const T n)
T integral_abs(const T n) noexcept
{
static_assert(std::is_integral_v<T>, "T is not an integral number type");

Expand Down

0 comments on commit d5ba024

Please sign in to comment.