rem gives this:
Prelude> rem 9 8
1
I wanted something like this:
Prelude> nonIntRem 9.1 8
1.0999999999999996
I implemented it like this:
nonIntRem x y = x - (y * (fromIntegral $ truncate (x/y)))
My questions are:
The function you're after is mod'
from Data.Fixed
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With