NTLib - Number Theory Library 0.9
Loading...
Searching...
No Matches
ntlib::ModIntAddable Concept Reference
module mod_int

Concept to ensure that no overflow can occur during addition or subtraction. More...

Concept definition

template<typename T, T m>
concept ModIntAddable =
!std::numeric_limits<T>::is_bounded ||
std::numeric_limits<T>::max() / 2 >= m
Concept to ensure that no overflow can occur during addition or subtraction.
Definition mod_int.cpp:32

Detailed Description

Concept to ensure that no overflow can occur during addition or subtraction.

Checks that T can hold at least \(2m\) which is required internally for addition and subtraction. If this concept is not satisfied, a bigger integer type must be used for T.