Arduino 60 * 1000 gives a strange number: integer constants overflow

Add UL to at least one number: 60UL * 1000. On an Uno an int holds up to 32767 only.

What the message means

The compiler calculates with the type of the constants. Two plain ints overflow before the result is stored in a larger variable.

Fix it in this order

  1. Write one constant as unsigned long, such as 60UL or 1000UL.
  2. Declare the variable as unsigned long.
  3. Check intermediate results, since a big product overflows before the next division.
  4. Print the value to confirm it.
  5. On 32-bit boards such as the ESP32 the problem is much rarer.

Why it happens

On an Uno an int is 16 bits and holds at most 32767. The expression 60 * 1000 is calculated as ints, so it overflows and gives a wrong number before it is stored in a larger variable.

Add the UL suffix so the maths uses unsigned long, for example 60000UL or 60UL * 1000.

If you see this, do this

You seeDo this
Interval is too short or negativeOverflow. Add UL.
Works on ESP32, fails on Unoint size.

int overflow, millis timing.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.