|
-
Apr 16th, 2002, 12:24 PM
#1
Thread Starter
Hyperactive Member
Data Types And Long Numbers
I have the following calculation
VB Code:
BigNumber = 10000000000000
SmallNumber = 943
MsgBox BigNumber \ SmallNumber
When using any of the Data Types I always get Error 6 "Overflow" returned, is there any way around this?
Thanks in Advance,
Matt
-
Apr 16th, 2002, 12:25 PM
#2
PowerPoster
-
Apr 16th, 2002, 12:29 PM
#3
Actually a long wouldnt work... You'll need to use a Single or Double (Single should be fine).
From Online Help...
A long integer between – 2,147,483,648 and 2,147,483,647.
A single-precision floating-point value with a range of – 3.402823E38 to – 1.401298E-45 for negative values, 1.401298E-45 to 3.402823E38 for positive values, and 0.
A double-precision floating-point value with a range of – 1.79769313486232E308 to – 4.94065645841247E-324 for negative values, 4.94065645841247E-324 to 1.79769313486232E308 for positive values, and 0
-
Apr 16th, 2002, 12:30 PM
#4
PowerPoster
well, I was wrong
Im stumped ... Decimal doesnt even work
-
Apr 16th, 2002, 12:31 PM
#5
PowerPoster
doh! I missed somehting ... use /
\ is int division
-
Apr 16th, 2002, 12:33 PM
#6
PowerPoster
VB Code:
Dim bignumber
Dim smallnumber
bignumber = CDec(10000000000000#)
smallnumber = CDec(943)
bignumber = CDec(bignumber)
smallnumber = CDec(smallnumber)
MsgBox bignumber / smallnumber
that works for sure!
-
Apr 16th, 2002, 01:04 PM
#7
Thread Starter
Hyperactive Member
Well
I really need to do this :
VB Code:
bignumber = CDec(10000000000000#)
smallnumber = CDec(943)
bignumber mod smallnumber
It is part of an algorithm and as I said all I get is Error 6 Overflow
Cheers
-
Apr 16th, 2002, 01:11 PM
#8
Thread Starter
Hyperactive Member
Well
Using the "Mod" Function and this number "1000000000#" works but when I use the slightly longer number of "100000000000000" it doesn't and that is when I get returned that nasty Overflow Message.
Cheers
-
Apr 16th, 2002, 01:44 PM
#9
Addicted Member
remember this
the number can not by endless
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
|