溢出问题
本帖最后由 pc528 于 2012-12-10 16:49:10 编辑 Dim Modulus, PeripheralForce As Single
Modulus = Val(cboModulu.Text)
PeripheralForce = 2000 * t(1) / (Modulus * Teeth1)
Dim Teeth1, Teeth2 As Single
通用声明 Public t(1 To 4) As Single
请问下怎么溢出
[解决办法]
Option Explicit
Private t(1 To 4) As Single
Private Sub Command1_Click()
Dim Modulus As Single, PeripheralForce As Single
Dim Teeth1 As Single, Teeth2 As Single
t(1) = 123.12
Teeth1 = 1.12345678
Modulus = Val(cboModulu.Text)
PeripheralForce = 2000 * t(1) / (Modulus * Teeth1)
Debug.Print PeripheralForce '结果是219.1806
End Sub
Private Sub Form_Load()
cboModulu.AddItem "1000"
cboModulu.ListIndex = 0
End Sub