MULTIPLO DE "0,25"
Pessoal como eu posso fazer p/ verificar se um numero é multiplo de "0,25".
Desde já obrigado
Raul
Desde já obrigado
Raul
Veja aqui...
Arquivo com exemplo
Arquivo com exemplo
Dim DadoPesq As Double
Dim nMultDE As Double
Dim nCont As Double
DadoPesq = 0.25
nMultDE = 0.25
For nCont = nMultDE To DadoPesq Step nMultDE
'nada faz nada
Next
If nCont - nMultDE = DadoPesq Then
MsgBox "é multiplo !"
Else
MsgBox "Não é multiplo !"
End If
Dim nMultDE As Double
Dim nCont As Double
DadoPesq = 0.25
nMultDE = 0.25
For nCont = nMultDE To DadoPesq Step nMultDE
'nada faz nada
Next
If nCont - nMultDE = DadoPesq Then
MsgBox "é multiplo !"
Else
MsgBox "Não é multiplo !"
End If
Dim DadoPesq As Double
Dim nMultDE As Double
Dim nCont As Double
DadoPesq = 2
nMultDE = 0.25
For nCont = nMultDE To DadoPesq Step nMultDE
'nada faz nada
Next
If nCont - nMultDE = DadoPesq Then
MsgBox "é multiplo !"
Else
MsgBox "Não é multiplo !"
End If
Dim nMultDE As Double
Dim nCont As Double
DadoPesq = 2
nMultDE = 0.25
For nCont = nMultDE To DadoPesq Step nMultDE
'nada faz nada
Next
If nCont - nMultDE = DadoPesq Then
MsgBox "é multiplo !"
Else
MsgBox "Não é multiplo !"
End If
Const iNum = 0.25
Dim iAux As Double
iAux = (Text1.Text * 100) Mod (iNum * 100)
If iAux = 0 Then
MsgBox "é multiplo de " & iNum
Else
MsgBox "Não é multiplo de " & iNum
End If
Dim iAux As Double
iAux = (Text1.Text * 100) Mod (iNum * 100)
If iAux = 0 Then
MsgBox "é multiplo de " & iNum
Else
MsgBox "Não é multiplo de " & iNum
End If
Tópico encerrado , respostas não são mais permitidas