|
-
Apr 5th, 2000, 12:00 AM
#1
Thread Starter
New Member
Hello!!!
I am making math operations that give a very big results. Inside intarations I have, for example
dim value_f as double
.
.
.
.
.
value_f=value_f + x*16*exp(i)
.
.
.
.
.
value_f is defined as Double, and its max value that can have a double variable is 1.7976913486232E308. When the operations results a big value, then occurs a overflow error.
Are there any way by use or declarate a bigger variable o continue making iterations without lost the program flow and will have the final result
Thanks
Juan Carlos
[email protected]
-
Apr 5th, 2000, 12:59 AM
#2
You can use Currency data type instead of Double. Currency holds 8 bytes of data instead of 4 bytes.
-
Apr 5th, 2000, 01:07 AM
#3
Addicted Member
Um, isn't a Double data-type 8 bytes, example:
Code:
Dim dblTemp As Double
Call MsgBox(LenB(dblTemp))
>> Displays "8"
I'm I wrong here?
-
Apr 5th, 2000, 02:49 AM
#4
Addicted Member
SonGouki is right. Both Double and Currency are 8 bytes and currency goes down up to 922,337,203,685,477.5807 and double
goes up to 1.79769313486232E308 for positive values. So double is bigger.
Sorry JCHACON,
-
Apr 5th, 2000, 02:54 AM
#5
transcendental analytic
DECIMAL is the best!
a = CDec(1E-28)
MsgBox a
a = CDec(1E+28)
MsgBox a
VB5 help says:
Decimal variables are stored as 96-bit (12-byte) unsigned integers scaled by a variable power of 10. The power of 10 scaling factor specifies the number of digits to the right of the decimal point, and ranges from 0 to 28. With a scale of 0 (no decimal places), the largest possible value is +/-79,228,162,514,264,337,593,543,950,335. With a 28 decimal places, the largest value is +/-7.9228162514264337593543950335 and the smallest, non-zero value is +/-0.0000000000000000000000000001.
-
Apr 5th, 2000, 08:10 AM
#6
Oops, don't I feel dumb. I was writing about Double, but was actually thinking aboud Long. Sorry about that....just a tough day.
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
|