ans$() = BigDivRem$(x$, y$ {, maxDigits})

This function divides two Big Decimal numbers and returns a two element array where ans$(0) is the quotient and ans$(1) is the remainder. The first parameter is the numerator and the second is the denominator.

The optional maxDigits parameter specifies the maximum number of digits to divide out. The maxDigits is only used internally during the divide and limits repeating decimal places. If the answer can not be expressed in maxDigits then "ERROR" is returned.

The optional maxDigits parameter specifies the number of digits to the left of the decimal place to take the calculations to internally. If omitted maxDigits defaults to the current BigMaxDigits setting. The BigFixDecimal command will still control the format of the numbers returned by Big Decimal functions. The number of digits and decimal places returned can be set with the BigPadDigits and BigFixDecimal commands.

For example:

ans$() = BigDivRem$("22", "7")
Print ans$(0), ans$(1)

3 1

Big Decimals

Become a Patron