Overflow

accessman2

Registered User.
Local time
Yesterday, 21:02
Joined
Sep 15, 2005
Messages
335
Hi,

I have a question.

dim num as Long

num = 123000234123

the message is giving out "Overflow".

Do we have another datatype instead of the "Long"? I know the "Long" datatype cannot support all digits (123000234123).

Its range is 2,147,483,648 to 2,147,483,647.

Does anybody know how to solve?
 
Double? Which is too short, so Double?
 
accessman2 said:
Hi,

I have a question.

dim num as Long

num = 123000234123

the message is giving out "Overflow".

Do we have another datatype instead of the "Long"? I know the "Long" datatype cannot support all digits (123000234123).

Its range is 2,147,483,648 to 2,147,483,647.

Does anybody know how to solve?


Long is the largest Int datatype. Here is some info I found.


Data type Description Range
Byte 1-byte binary data 0 to 255
Integer 2-byte integer – 32,768 to 32,767
Long 4-byte integer – 2,147,483,648 to 2,147,483,647
Single 4-byte floating-point number – 3.402823E38 to – 1.401298E – 45 (negative values)
1.401298E – 45 to 3.402823E38 (positive values)
Double 8-byte floating-point number – 1.79769313486231E308 to
– 4.94065645841247E – 324 (negative values)
4.94065645841247E – 324 to 1.79769313486231E308 (positive values)
Currency 8-byte number with fixed decimal point – 922,337,203,685,477.5808 to 922,337,203,685,477.5807
String String of characters Zero to approximately two billion characters
Variant Date/time, floating-point number, integer, string, or object.
16 bytes, plus 1 byte for each character if a string value.
Date values: January 1, 100 to December 31, 9999
Numeric values: same range as Double

String values: same range as String Can also contain Error or Null values

Boolean 2 bytes True or False
Date 8-byte date/time value January 1, 100 to December 31, 9999
Object 4 bytes Any Object reference
 
Here is a link on datatypes.


Here is a sample from it....
Use the Double setting when you need many decimal places or very large numbers.
 

Users who are viewing this thread

Back
Top Bottom