According to the MSDN help for VB6
Floating-point values can be expressed as mmmEeee or mmmDeee, in which mmm is the mantissa and eee is the exponent (a power of 10). The highest positive value of a Single data type is 3.402823E+38, or 3.4 times 10 to the 38th power; the highest positive value of a Double data type is 1.79769313486232D+308, or about 1.8 times 10 to the 308th power. Using D to separate the mantissa and exponent in a numeric literal causes the value to be treated as a Double data type. Likewise, using E in the same fashion treats the value as a Single data type.
Now in the VB6 IDE I've tried to enter this
const MAX_DOUBLE as Double = 1.79769313486232D+308
however, as soon as I move away from that line the IDE throws an Error 6 (Overflow)
An overflow results when you try to make an assignment that exceeds the limitations of the target of the assignment. ...
So how do I get MAX_DOUBLE (and MIN_DOUBLE for that matter) defined?
Edit: Solved it!
Const test As Double = 1.79769313486231E+308 + 5.88768018655736E+293
Double checked it down to the binary level, that should be as high as you can go. You can keep adding values like 1 etc but it yields a number equal to, not greater than. Output is this: 01111111|11101111|11111111|11111111|11111111|11111111|11111111|11111111 Which is indeed DoubleMax
Old: You could just use Positive infinity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With