vb如何解决数据溢出
答案:2 悬赏:0 手机版
解决时间 2021-02-03 10:59
- 提问者网友:無理詩人
- 2021-02-02 11:37
vb如何解决数据溢出
最佳答案
- 五星知识达人网友:风格不统一
- 2021-02-02 12:33
Private Sub Command1_Click()
Dim a As Double, b As Double, c As Double
Dim d As Double, e As Double, f As Double
Dim p As Double, q As Double, r As Double, k As Double
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text4.Text)
e = Val(Text5.Text)
f = Val(Text6.Text)
p = Sqr(a ^ 2 + b ^ 2 + c ^ 2)
q = Sqr(d ^ 2 + e ^ 2 + f ^ 2)
r = (a * d + b * e + c * f) / (p * q)
k = Atn(-r / Sqr(-r * r + 1)) + 2 * Atn(1)
MsgBox "Vector angle is " & Format(k, "0.00")
End Sub后面的Text1_Change等代码全部删掉
Dim a As Double, b As Double, c As Double
Dim d As Double, e As Double, f As Double
Dim p As Double, q As Double, r As Double, k As Double
a = Val(Text1.Text)
b = Val(Text2.Text)
c = Val(Text3.Text)
d = Val(Text4.Text)
e = Val(Text5.Text)
f = Val(Text6.Text)
p = Sqr(a ^ 2 + b ^ 2 + c ^ 2)
q = Sqr(d ^ 2 + e ^ 2 + f ^ 2)
r = (a * d + b * e + c * f) / (p * q)
k = Atn(-r / Sqr(-r * r + 1)) + 2 * Atn(1)
MsgBox "Vector angle is " & Format(k, "0.00")
End Sub后面的Text1_Change等代码全部删掉
全部回答
- 1楼网友:独行浪子会拥风
- 2021-02-02 12:53
a,b,c,d,e,f有没有声明变量呢?
把它们都声明为 Double 类型。
把它们都声明为 Double 类型。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯