[SOLVED] Can I? Math/Logic: Compare long with int ??? (YES!)

Esteemed Forum Participants and Lurkers: . . . NEWBIE ALERT!

I have a timer variable "TimeL" that is incremented once per second and is type "long" because it has to count for at least a full day, which is 86,400 seconds.

I have several points in my program that compare integer constants or variables to the timer, such as the following:

long TimeL;
const int hourly = 3600;
 ... 
if (TimeL < hourly) { ... less than 1 hour code goes here ... ;  }

So, is the comparison math handled correctly if I compare type int to type long, or type long to type int? Or do I have to cast the type int to type long before doing the comparison to a type long? This question isn't covered at all in the Arduino Reference pages.

Thank you most sincerely for any and all comments, suggestions, and assistance.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle, PA USA

It is handled fine. C automagically casts the comparison to the longest type.

Thank you very much, majenko ...

I was pretty sure it would be handled correctly. It sure would be helpful if your statement was included in the "Comparison Operators" page in the Arduino Reference (http://arduino.cc/en/Reference/If).

Blessings in abundance, all the best, & ENJOY!
Art in Carlisle, PA USA

There's many things that would be helpful to be included in the Arduino site.

You're better off using a C reference site than the Arduino for anything that's not to do with the Arduino's hardware or libraries.