I'm working on sml project in which I have to implement these two function rem & mod for custom datatype.
I know the definition of remainder rem.
dividend = divisor * quotient + remainder
What is the definition of mod? Please explain me the difference between these in simple words.
In i mod j, the result has the same sign as j.
In i rem j, the result has the same sign as i.
You can look up the details in the documentation for Basis.
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