程序中我定义了b为整型,b进行自加运算,但是我需要判断b/12是否为整型,如何编程。望高手指教。
最好加Q教。谢谢大家了。。
Private Sub Command1_Click()
Dim b As Integer
b = 133
If floor(b / 12) = ceil(b / 12) Then
Print "b/12是整形"
Else
Print "b/12不是整形"
End If
End Sub
Function ceil(n As Double) As Integer
ceil = -Int(-n)
End Function
Function floor(n As Double) As Integer
floor = Int(n)
End Function