I'm not sure I understand the question.
Is this the question? how can I determine if the second number is an integral multiple of the first? If that is the question, this is how to do it (This is a VB6 program)
Dim FirstValue As Double
Dim SecondValue As Double
FirstValue = 15
SecondValue = 3
If (CInt(FirstValue / SecondValue) * SecondValue = FirstValue) Then
Call MsgBox("The second value is an integral multiple of the first", vbInformation)
Else
Call MsgBox("The second value is NOT an integral multiple of the first", vbInformation)
End If
You can also do it this way (using the "\" operator, the integral division operator).
If ((FirstValue \ SecondValue) * SecondValue = FirstValue) Then
Call MsgBox("The second value is an integral multiple of the first", vbInformation)
Else
Call MsgBox("The second value is NOT an integral multiple of the first", vbInformation)
End If
The key is the "CInt" or the integer division operator "\". Other languages have other functions to do the same thing (Trunc, Fix, IFIX, etc. VB has the FIX operator.) Basically, you throw away the fractional part (or the remainder). If you then multiply by the divisor, you should get back the original number. If you don't, it's not an integral multiple.
Note that VB is somewhat more forgiving than some other languages. In some languages. Round-off errors can make the IF statement fail incorrectly. In these cases, you would have to do something like this:
Dim TestValue as double
TestValue = ((FirestValue \ SecondValue) * SecondValue) - FirstValue
if ABS(TestValue) < 0.0000001 then
' The second value is an integral divisor
else
' The second value is NOT an integral divisor
end if