xte ::wrap ()
Defined in header <xte/math/wrap.hpp> Computes modulo between two inclusive limits. Casts arguments to their common type.
Definition
[[nodiscard ]]constexpr auto wrap (xte ::is_number auto x ,xte ::is_number auto limit0 ,xte ::is_number auto limit1 )noexcept ;
Example
Output:for (int i =-1 ;i <=5 ; ++i ) {std ::println ("{}" ,xte ::wrap (i ,1 ,3 )); }
[View in Compiler Explorer]2 3 1 2 3 1 2