In other words, returns the remainder when you divide by . In some languages like Python or Perl this is equivalent to % is the modulus operator. Thus in MATLAB is the same as x % y in other languages. There is also a remainder function that has the same functionality as EXCEPT when ...
In this case, we use the rand function, the return value of which is paired with the desired maximum value using the modulo operator. #include <ctime> #include <iostream> #include <vector> using std::cin; using std::cout; using std::endl; using std::vector; constexpr int MAX = ...
To strengthen my point, the % operator in JavaScript is called the 'remainder operator', and when used, performs the remainder operation. Other languages vary in their naming and behaviour, for instance: MatLab has both mod and rem, hlsl has fmod even though it actually performs the remainder...