The dividend Big instance.
The divisor Big instance.
Optional
precision: number = DEFAULT_PRECISIONThe number of decimal places to keep in the result (optional). Defaults to the maximum scale of both Big instances. If the precision is lower than the scale of the result, the result will be rounded. If input numbers are without scale, the precision will be 0, so the result will be rounded to an integer.
Optional
roundingMode: RoundingMode = "half-up"The rounding mode to apply ("half-up", "down" or "up"). Defaults to "half-up".
Optional
mutable: boolean = falseWhether to mutate the dividend or not. Defaults to false.
Division by zero is not allowed.
const big1 = new Big(10);
const big2 = new Big(3);
console.log(divBig(big1, big2).toString()); // "3.33333333333333333333"
console.log(divBig(big1, big2, 0).toString()); // "3"
console.log(divBig(big1, big2, 2).toString()); // "3.33"
console.log(divBig(big1, big2, 2, "down").toString()); // "3.33"
console.log(divBig(big1, big2, 2, "up").toString()); // "3.34"
Generated using TypeDoc
Divides two Big instances and returns the result as a new Big instance.