I'm trying to make a Haskell function that calculates x mod y:
fmod :: Double -> Double -> Double
fmod x y = x - y*m
where m = floor a
a = x / y
Running this in stack yields:
No instance for (Integral Double) arising from a use of `floor'