I believe that the modulo works only with integers, if I'm right you should do your own workaround to see if the given number is a multiple or not, which translate to: the result of the division must be an integer.
The code should be something like this:
let floatDivision = input/increment;
let isInteger = floor(floatDivision) == floatDivision // true
if (isInteger) {
println("Pass")
} else {
println("Fail")
}
And this should work with any increment number (even more than one decimal point digit).
EDIT
as James Said, the float division of 1.2 over 0.1 is not coded exactly as 12 but 11.9999... So I added the epsilon in the comparison:
let input = 1.2;
let increment = 0.1;
let epsilon = 0.00000000000001;
let floatDivision = input/increment;
let dif = abs(round(floatDivision) - floatDivision);
println(String(format: "%.20f", floatDivision)); // 11.99999999999999822364
println(String(format: "%.20f", round(floatDivision))); // 12.00000000000000000000
println(String(format: "%.20f", dif)) // 0.00000000000000177636
let isInteger = dif < epsilon // Pass if (isInteger) {
println("Pass") } else {
println("Fail") }
Best of luck.