blinkWithoutDelay, unsigned currentMillis vs signed previousMillis

I am using arduino version 22, and I was checking out the blinkWithoutDelay example. The currentMillis variable is declared as an unsigned long, and the previousMillis is declared as a signed long. Is this correct? If so, how does it work when the currentMillis variable exceeds the max value which can be stored in previousMillis variable? Sorry if this is a dumb question, I am relatively new to this.

gregtomko:
The currentMillis variable is declared as an unsigned long

Which is correct.

and the previousMillis is declared as a signed long

Which is wrong. unsigned long is the correct data-type.

Make sure any duration or elapsed time calculations are type unsigned long also. i.e. elapsed_time = currentMillis - previousMillis; or if (millis() - previousMillis >= duration) { // action }