Whenever you write an equation in C/C++, the data types being operated on have a very real effect on the equation's output.
Each type like
unsigned long have different behaviors, and take a certain amount of space in memory to store.
int (on arduino) is store in 16 bits, with half of its values being given to negative numbers, half-1 given to positive values, and one value given to 0. That gives it a range of -2^15 (-32,768) to +2^15-1 (32,767).
unsigned long (on arduino) is 32 bits, but none are designated as negative. its range is then 0 to 2^32-1 (4294967295).
What kind of math? What kind of other type of processing is excluded
while working with millis?
The crux of the issue is that it the time millis returns ever got past 32767 and you tried to store it in an int, the arduino couldn't do it, because an
int can't hold that big of a number. The type of math this is off limits is math happening to smaller data types, not any specific operations. Maybe these examples will help:
int i = 32767;
//No problems here; it fits just fine
i = 32767 + 1;
//Oh no, the value didn't fit
unsigned long fake_millis = 42000;
i = fake_millis;
//This is an example of millis going past an int
i = -10;
unsigned int j = i;
//no way to put a negative number in an unsigned value
uint32_t k = fake_millis;
//unsigned long is a uint32_t on arduino; this works great!
The way this is implemented is really quite genius; If you are interested in where these numbers come from and why they spill over in the way they do you should look into same explanations of two's complement number representations.