No idea if this is correct for floating point values, but it is for integers (may have to double check for modulo and negative values).
Also x % 1 => 0.