主题:[讨论]数据精度?
我的Command按钮下执行如下操作
Private Sub Command3_Click()
Text3.Text = Val(Sin(Text1.Text)) + Val(Log(Text2.Text))
If Val(Sin(Text1.Text) + Val(Log(Text2.Text)) <> Val(Text3.Text) Then
Command1.Caption = " 不相等"
Else
Command1.Caption = " 相等"
End If
End Sub
为啥结果总是不相等呢?
Private Sub Command3_Click()
Text3.Text = Val(Sin(Text1.Text)) + Val(Log(Text2.Text))
If Val(Sin(Text1.Text) + Val(Log(Text2.Text)) <> Val(Text3.Text) Then
Command1.Caption = " 不相等"
Else
Command1.Caption = " 相等"
End If
End Sub
为啥结果总是不相等呢?