Home > Software engineering >  The great god will soon see, I of the vb program is running overflow is why show?
The great god will soon see, I of the vb program is running overflow is why show?

Time:11-30

Dim k1, k2, k3m k4m, la3, la4, lam, ga, w3, w4, xf, ye, CTM, CTF, CFD, cl, fi1, fi2, fi3, fi4, fi3f, fi4f, fi5, wf, AD, r1, r2, m1, m2, f3 and f4, a0, a1, a2, a4, b1, b2, b4, b5, G, B, C, nt3d, nt4d, nt1d, nt2d As Double

This sentence shows that overflow
B1 r2=r1 * * (Exp (r1 * (xf - xe)) - Exp (r2 * (xf - xe)))/(r1 * Exp (r2 * (xf - xe)) - r2 * Exp (r1 * (xf - xe)))
O great god save me!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

MsgBox 0/0

CodePudding user response:

You omitted the As a Double of the variables are not Double, you are still a lot more than the whole statement
And check (r1 * Exp (r2 * (xf - xe)) - r2 * Exp (r1 * (xf - xe))) this part whether the result is 0

CodePudding user response:

First of all, because you are lazy, only the last one is doubule all variables, other are not

Error check (r1 * Exp (r2 * (xf - xe)) - r2 * Exp (r1 * (xf - xe))), not necessarily is 0, it is also possible that this value is very small, in short, an error when the formula broken down step by step calculation, and overflow, and see which step to check the numerical or logic is correct,


CodePudding user response:

MD,
What you value is not assigned, the division becomes 0/0, lead to overflow,
The inside of the other formulas xe is not defined

CodePudding user response:

To compound expressions manually disassembled for as far as possible simple expressions step by step, step through again,

CodePudding user response:

Most of overflow is to divide 0 there is nothing to say, check it

CodePudding user response:

overflow error (6), when the assignment was beyond the limit of the target, overflow occurs,
This error has the following cause and solution:

Assignment, calculation, or data type conversion is too large, the results of that cannot be represented within the range allowed by the variable type,
Assigned to said enough value scope of variables of type,

Value assigned to the property exceeds the maximum limit properties can accept,
Ensure that the scope of the assignment for attribute

Attempt to use a number in the calculation, and the number is mandatory as an integer, but the result over the range of integers, for example:
Dim x As Long
X=2000 * 365 'error: overflow
To solve this problem, as follows, please enter the number:

Dim x As Long
X=CLng (2000) * 365
  • Related