is this a compiler bug?

using delays in milliseconds is not so convenient, so I was aiding myself by setting one our as:
60601000; however, there seems to be a bug:

unsigned long x = long(10101000);
unsigned long y = long(1010100);
unsigned long z = long(10*1000);

void setup() {
Serial.begin(9600);
delay(3000);
Serial.println (x);Serial.println (y);Serial.println (z);
}

void loop() {}

yields:

4294936224
10000
10000

Or what do I do wrong?

Arduino version 22

The compiler is seeing three ints - 10, 10, and 1000. It performs integer arithmetic on them. 10 * 10 = 100. 100 * 1000 = -31072.

On the other hand, 10UL * 10UL * 1000UL would indicate to the compiler that the values are unsigned longs, and 10UL * 10UL = 100UL. 100UL * 1000UL = 100000UL.

Compilers are pretty complex, but not all that smart. They don't know that an intermediate value should be promoted to a larger type, unless you tell it. The UL on the end is how you tell the compiler to use a larger type for intermediate results.

thanks, that helps!