Template Function rclcpp::add_will_underflow
Defined in File utilities.hpp
Function Documentation
-
template<typename T>
bool rclcpp::add_will_underflow(const T x, const T y) Safely check if addition will underflow.
The type of the operands, T, should have defined std::numeric_limits<T>::min(),
>
,<
and-
operators.- Parameters:
x – [in] is the first addend.
y – [in] is the second addend.
- Template Parameters:
T – is type of the operands.
- Returns:
True if the x + y sum is less than T::min value.