std::numeric_limits<T>::is_modulo
From cppreference.com
< cpp | types | numeric limits
static const bool is_modulo; |
(until C++11) | |
static constexpr bool is_modulo; |
(since C++11) | |
The value of std::numeric_limits<T>::is_modulo is true for all arithmetic types T
that handle overflows with modulo arithmetic, that is, if the result of addition, subtraction, multiplication, or division of this type would fall outside the range [
min(),
max()]
, the value returned by such operation differs from the expected value by a multiple of max() - min() + 1.
is_modulo
is false for signed integer types, unless the implementation defines signed integer overflow to wrap.
Contents |