R integer multiplication overflow: why do I get NA instead of a double result?
21:57 30 Mar 2026
x
[1] 21475
> typeof(x)
[1] "integer"
> y
[1] 100000
> typeof(y)
[1] "integer"
> x * y
[1] NA
Warning message:
In x * y : NAs produced by integer overflow

I have always known that R will automatically promote/coerce to double instead of having overflow like in C/C++

From the example above, I find it a bit weird that we have an overflow. Is this a new feature in R or has this always been the case?

r integer