Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • Leaders
Posted
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.
[sIGPIC]e[/sIGPIC]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...