Got a problem with a code conversion from C# to VB.Net.
var x = 5783615;
var y = 56811584;
var t = x * y;
x, y and t are integers. In c# 't' will be -1553649728. In VB.Net, I will get an integer overflow exception.
Any idea how to fix it?
C#, by default, doesn't check for overflows, but VB does (by default).
You can setup your VB Project to not check for integer overflows in the Advanced Compile Options in the Compile tab. This will cause that specific project to stop raising OverflowException in cases like this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With