4 ms·
Julia has functions divrem and fldmod that each return the quotient and remainder, with one or the other convention.
by FabHK 4y ago
Julia has functions divrem and fldmod that each return the quotient and remainder, with one or the other convention.
- StefanKarpinski 4y agoThe `rem`, `div` and `divrem` functions also all optionally take a rounding mode argument that lets you have the behavior that matches any rounding mode, where `RoundToZero` matches `div` and `RoundDown` matches `mod`, but there are actually a total of seven rounding modes. Most of them are pretty useless, but if you need some style of division and the remainder to match, this is very helpful.