function overflow() a = 2^63 return a end overflow() function overflow_no() a = BigInt(2)^63 return a end overflow_no()
In the above example overflow() will overflow with no warning, but overflow_no() works fine. This is a very subtle “bug” that data scientists coming from a pure statistics/machine learning background may not fully appreciate and can cause lots of headaches in debugging.
Wouldn’t it make sense for Julia to have a way to define an auto-promotion rule for bit types when it overflows? E.g. auto promote the Int64 to BigInt when it overflows. This feels more natural to me, a mathematician/statistician by training.