Quick solution, just multiply fraction by powers of two until it becomes integer. (you're dealing with binary numbers after all) Finally, divide integer remainder by same power of two
ex)
2 x (4 % 0.5) = 8 % 1 = 0
2 x (4 % 2.5) = 8 % 5 = 3
4 % 2.5 = 3/2
Also, the trick to extending mod to fractions is Bezout's identity.