It seems that the compiler did the math with ints, since both of the operands are ints, and the result rolled over.
Yes, it would do that. In this case:
long interval = (5000000); gave 5000000
Clearly the compiler recognizes that 5000000 can't be an int so it promotes it.
long interval = (100*1000); gave -31072
The expression (the RH side) involves ints, so the arithmetic is done at int level. Then it happens to be assigned to a long, but too late.
Personally I would promote the first one:
long interval = 100L * 1000;
(I don't know what the brackets achieve in this case).
And as CrossRoads said, intervals are usually unsigned long, not just long (long being signed long).