How to throw an error on value overflow?


#1

For example, in Int64:

10^21 returns 3875820019684212736

How do you turn off rollover and just throw an error instead?


#2

You can’t, but upon consideration I feel like it might be worth it to do integer overflow checking for ^. It’s relatively isolated, and it’s the most common place where people encounter this. I’ll submit a PR to this effect and see what people think.


#3

PR can be seen here: