|
-
Nov 11th, 2001, 01:19 PM
#1
Dazed Member
ints in Java are not from -32767 to 32767, it is something much larger (forgot at the moment).
The short datatype is equivlent to the integer datatype in Visual Basic it ranges from -32,768 to 32,767. *~ note ~ * This applies to Visual Basic 6 not VB.Net (aka VB7). int ranges from -2147483648 to 2147483647
When im having trouble remembering the ranges of numeric primative types i often think of them in exponent form like this.
short = -2^15(-32,768) to 2^15(32,767)
integer = -2^31(-214783648) to 2^31(214783648)
I dont think that a number that large would compile to an integer.
Remember that a numerical overflow occurs when the result of a calculation is larger then the largest value that can be represented by it's type. So i think the same would apply when trying to initialize a variable with a value larger then it can hold.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|