Visual Basic (17)

16 Name: #!/usr/bin/anonymous : 2017-01-19 05:42 ID:f+q+80vG

Been years since I did anything serious in VB but you can probably do something like:

C = A / B
If C = Math.Floor(C) Then

DoSomething()

End If

Though if either A or B is floating point, C may not be exactly 0 even when it should, due to silly rounding errors. To be safe, it might be better to do something like

Epsilon = 0.000001
C = A / B
If (Math.Abs(C - Math.Floor(C)) < Epsilon) Then

DoSomething()

End If

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: