I'm checking if the inputted number is a factor of 100 using the following formula:
100 % n === 0
But when someone enters 0.02
it says that 100 % 0.02 = 0.0199999999999979
which is incorrect.
Why is this happening and how can I solve this?
I also tried using: Math.Abs(100 % 0.02)
but it gives me the same result which is 0.0199999999999979
.