user7728: Copied from the Arduino reference - millis()

Tip: Note that the parameter for millis is an unsigned long, errors may be generated if a programmer tries to do math with other
  datatypes such as ints.

What kind of math? What kind of other type of processing is excluded while working with millis? 
Could someone clarify this statement and/or give some example? 

user7701: When you want to do stuff with millis() just remember to initialize your variable with type "uint32_t"
So do something like "uint32_t last_millis" where you will store the output of the "millis()" function.
Otherwise like the others said, it would overflow when going past 31,000 which will happen pretty quickly.

user-1: millis() returns a unsigned long, which is a 32-bit unsigned integer on the Arduino. When you then try to do something like unsigned int time = millis() - 1000, you try to store that in a 16-bit unsigned integer unsigned int. A 16-bit integer can never hold a 32-bit value.
According to the C specification, paragraph 6.3.1.3, the upper 16 bits are discarded.
If possible, keep the millis() output in a unsigned long and only use data types with less bits when you're absolutely sure you will not lose bits. 
There's more information on explicit casts in C here: https://stackoverflow.com/a/13652624/1544337

user1585: 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 int, float, and 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;
  Serial.println(i);
  //No problems here; it fits just fine


32767

  i = 32767 + 1;
  Serial.println(i);
  //Oh no, the value didn't fit


-32768

  unsigned long fake_millis = 42000;
  i = fake_millis;
  Serial.println(i);
  //This is an example of millis going past an int


-23536

  i = -10;
  unsigned int j = i;
  Serial.println(j);
  //no way to put a negative number in an unsigned value


65526

  uint32_t k = fake_millis;
  Serial.println(k);
  //unsigned long is a uint32_t on arduino; this works great!


42000

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.

7728: <p>Copied from the <a href="http://arduino.cc/en/Reference/Millis" rel="noreferrer">Arduino reference - millis()</a></p>

<blockquote>
  <p><strong><em>Tip</strong>: Note that the parameter for millis is an unsigned long, errors may be generated if a programmer tries to do math with other
  datatypes such as ints.</em></p>
</blockquote>

<p>What kind of math? What kind of other type of processing is excluded while working with millis? </p>

<p>Could someone clarify this statement and/or give some example? </p>
 7701: <p>When you want to do stuff with millis() just remember to initialize your variable with type "uint32_t"</p>

<p>So do something like "uint32_t last_millis" where you will store the output of the "millis()" function.</p>

<p>Otherwise like the others said, it would overflow when going past 31,000 which will happen pretty quickly.</p>
 -1: <p><code>millis()</code> returns a <code>unsigned long</code>, which is a 32-bit unsigned integer on the Arduino. When you then try to do something like <code>unsigned int time = millis() - 1000</code>, you try to store that in a 16-bit unsigned integer <code>unsigned int</code>. A 16-bit integer can never hold a 32-bit value.</p>

<p>According to the <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf" rel="nofollow noreferrer">C specification</a>, paragraph 6.3.1.3, the upper 16 bits are discarded.</p>

<p>If possible, keep the <code>millis()</code> output in a <code>unsigned long</code> and only use data types with less bits when you're absolutely sure you will not lose bits. </p>

<p>There's more information on explicit casts in C here: <a href="https://stackoverflow.com/a/13652624/1544337">https://stackoverflow.com/a/13652624/1544337</a></p>
 1585: <p>Whenever you write an equation in C/C++, the data types being operated on have a very real effect on the equation's output. </p>

<p>Each type like <code>int</code>, <code>float</code>, and <code>unsigned long</code> have different behaviors, and take a certain amount of space in memory to store. </p>

<p><code>int</code> (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).</p>

<p><code>unsigned long</code> (on arduino) is 32 bits, but none are designated as negative. its range is then 0 to 2^32-1 (4294967295).</p>

<blockquote>
  <p>What kind of math? What kind of other type of processing is excluded
  while working with millis?</p>
</blockquote>

<p>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 <code>int</code> 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:</p>

<pre><code>  int i = 32767;
  Serial.println(i);
  //No problems here; it fits just fine
</code></pre>

<blockquote>
  <p>32767</p>
</blockquote>

<pre><code>  i = 32767 + 1;
  Serial.println(i);
  //Oh no, the value didn't fit
</code></pre>

<blockquote>
  <p>-32768</p>
</blockquote>

<pre><code>  unsigned long fake_millis = 42000;
  i = fake_millis;
  Serial.println(i);
  //This is an example of millis going past an int
</code></pre>

<blockquote>
  <p>-23536</p>
</blockquote>

<pre><code>  i = -10;
  unsigned int j = i;
  Serial.println(j);
  //no way to put a negative number in an unsigned value
</code></pre>

<blockquote>
  <p>65526</p>
</blockquote>

<pre><code>  uint32_t k = fake_millis;
  Serial.println(k);
  //unsigned long is a uint32_t on arduino; this works great!
</code></pre>

<blockquote>
  <p>42000</p>
</blockquote>

<p>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.</p>
