# math.round-div-big
`math.round-div` for integers of any size. The numerator and denominator are
decimal strings (the form `math.big-integer` uses), and so is the answer:
`roundDivBig("9007199254740993", "2", "down")` is `"4503599627370496"`.
## Why it exists
Exact money arithmetic multiplies before it divides: litres from a distance
and a fuel economy, times a price in tenths of a penny, or a value retained
through several years of depreciation at basis-point rates. The product passes
2^53 quickly, and `math.round-div` takes a JavaScript `number` (and a Rust
`i64`), which silently loses digits past that point. Doing the one rounding
step here keeps the answer exact and identical in all three languages.
## Rounding
Exactly math.round-div's modes, applied to the magnitude with the sign put
back afterwards:
- `half-up`: ties away from zero (7/2 is 4, -7/2 is -4);
- `half-even`: ties to the even neighbour (5/2 is 2, 7/2 is 4);
- `down`: towards zero;
- `up`: away from zero.
A negative quotient that rounds to nothing is `"0"`, never `"-0"`.
## Input form
Canonical decimal integers only, as `math.big-integer` parses them: an
optional `-`, then digits, no leading zeros, no `+`, no point, no spaces.
Anything else is an error, as is a zero denominator or an unknown mode.