Basic question: How far do I have to go to assure that integer math is done correctly? For example, this is probably overdone:
unsigned long burnTime = 0UL;
unsigned long curBurnTime = 0UL;
// Do some stuff that sets the above variables to millis() at various times
// Later on...
unsigned long adjustedBurnTime = (unsigned long) ((burnTime + curBurnTime) / 1000UL);
Would the math be done correctly if I went to a more minimal last statement (since all the elements of the equation are unsigned longs)? Like this:
unsigned long adjustedBurnTime = ((burnTime + curBurnTime) / 1000UL);
Or even:
unsigned long adjustedBurnTime = ((burnTime + curBurnTime) / 1000);