Question: Is there a way to determine whether dividing one number by another will result in whole number in JavaScript? Like `18.4 / 0.002` gives us `9200`, but `18.4 / 0.1` gives us `183.99999999999997`. The problem is that both of them may be any float number (like 0.1, 0.01, 1, 10, ...) which makes it impossible to use the standard function modulo or trying to subtract, and floating point precision issues mean we will sometimes get non-whole-number results for numbers that should be whole, or whole-number results for ones that shouldn't be.

Answer: 
One hacky way would be 

1. Convert both numbers to strings with `toString()`
2. Count the precision points (N) by stripping off the characters before the `.` (including the `.`) and taking the length of the remaining part
3. Multiply with 10^N to make them integers
4. Do modulo and get the result

Updated Demo: <http://jsfiddle.net/9HLxe/1/>

```
function isDivisible(u, d) {
    var numD = Math.max(u.toString().replace(/^\d+\./, '').length, 
                        d.toString().replace(/^\d+\./, '').length);
    u = Math.round(u * Math.pow(10, numD));
    d = Math.round(d * Math.pow(10, numD));
    return (u % d) === 0;
}

```
I Assume that you want the reminder to be zero when you perform the division.

check for the precision of the divisor, and multiply both divisor and divident by powers of 10

for example 

you want to check for `2.14/1.245` multiply both divident and divisor by `1000` as `1.245` has 3 digits precision, now the you would have integers like `2140/1245` to perform modulo