markc Posted March 20, 2006 Posted March 20, 2006 int x = 2000000000 * 2000000000; in java gives -1651507200 in vb, the same yields an overflow, and Code: math.bigmul(2000000000 * 2000000000 ) yields 4000000000000000000 ive learned that this is because java simply drops the higher order bits in order to fit it into the integer type my question is, how do i accomplish the same in .NET? Im transfering some code over and I was wondering if there was anything in the framework that does it thanks Quote
markc Posted March 20, 2006 Author Posted March 20, 2006 oops sorry this is vb.NET could a mod move this to Vb.NET, sorry :D Quote
Leaders snarfblam Posted March 20, 2006 Leaders Posted March 20, 2006 In VB.Net, the only control for whether or not integer overflow checking is enabled (as far as I know) is to set it in the project's properties (or using the /removeintchecks switch if you are using the command line). This will effect every integer operation in the assembly though. Quote [sIGPIC]e[/sIGPIC]
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.