Does this sound good?
PHP Code:Function Modular(Num1, Num2)
Divided = Num1 / Num2
If Divided = Int(Divided) Then
Modular = 0
Else
FractionPart = Divided - Int(Divided)
Modular = FractionPart * Num2
End If
End Function
Printable View
Does this sound good?
PHP Code:Function Modular(Num1, Num2)
Divided = Num1 / Num2
If Divided = Int(Divided) Then
Modular = 0
Else
FractionPart = Divided - Int(Divided)
Modular = FractionPart * Num2
End If
End Function
You found a workaround, nice one ;) It gave the same result as 12345 Mod 6 so i'd say so. Code looks good too (apart from you haven't declared any of the variables!)
I know... I usually declare the variables... I will probably do it when I finish the program...