Hi guys,
What is the bit size of ints in Dart?
The reason I ask is because of this ...
int a = 0xFFFFFFFF;
int b = 255 << 24 | 255 << 16 | 255 << 8 | 255;
print(a); // 4294967295
print(b); // 4294967295
print(a.runtimeType); // int
Normally I would expect those values to wrap around to -1 (32-bit signed integer) which is why the behaviour here caught me off guard. Is the Dart VM converting ints to doubles behind the scenes or is something else going on here?
Thanks :)
FYI, the code is running in the Dart VM.