LongDivision - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Student[Basics]

  

LongDivision

  

generate steps for numeric and polynomial long division

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

LongDivision( dividend, divisor )

LongDivision( dividend, divisor, variable )

Parameters

dividend

-

integer, float, or polynomial

divisor

-

integer, float, or polynomial

variable

-

(optional) name

appendresult

-

(optional) true or false

digits

-

(optional) non-negative integer

decimaldigits

-

(optional) non-negative integer

output

-

(optional) one of typeset,string,qr,printf, canvas, or link; format of result

Description

• 

The LongDivision command shows the steps in dividing dividend/divisor by constructing a tableau:

                              quotient

                            ---------------

                    divisor ) dividend

                              ... steps ...

• 

This command shows the steps for integer, floating-point, and polynomial long division.  

• 

When divisor and/or dividend are polynomials, the inputs may first be rearranged in a standard form as returned by collect.  If no variable is given for which to collect the terms by, it picks a variable for you.

• 

When appendresult=true, the output includes the result, quotient + remainder/divisor, in addition to the long division.  By default appendresult=false.

• 

When dividing numbers, there are two similar options for controlling how far to proceed if a zero remainder is not reached.  Both options only apply after exhausting the digits in the dividend.  After this, the digits=n option causes division to continue until n significant digits have been computed in the quotient.  Alternately, the decimaldigits=m causes division to continue until m digits have been computed to the right of the decimal point in the quotient.

• 

The default output format, typeset, is chosen for the best visual display in the standard document interface.  The output option can be set to printf for an alternate, character-based visual display. The string output is the same character-based format as printf, but returned as a string, so that it can be further processed in your own code.  Note that when the string output is displayed, it is center-formatted and will not look as good as output=printf.  The output=qr option returns a pair of values: the quotient as computed, and the number at the bottom of the tableau (the remainder for exact integer and polynomial division).

• 

A MapleLearn canvas can be created that contains the long division output by using the option output=canvas or output=link.

• 

The option output=link produces MathML representing the long division using the <longdiv> tag.

• 

This function is part of the Student:-Basics package.

Examples

withStudent:-Basics&colon;

LongDivision1001&comma;30

 &mdash; &mdash; &mdash; &mdash;3&mdash;3&mdash; 30 &rpar; 1001       9&mdash;0&mdash;       101        9&mdash;0&mdash;        11

(1)

LongDivision1001&comma;30&comma;appendresult=true

 &mdash; &mdash; &mdash; &mdash;3&mdash;3&mdash; 30 &rpar; 1001       9&mdash;0&mdash;       101        9&mdash;0&mdash;        11&equals;33+1130

(2)

LongDivision1001&comma;30&comma;decimaldigits=2

 &mdash; &mdash; &mdash; &mdash;3&mdash;3&mdash;&period;&mdash;3&mdash;6&mdash; 30 &rpar; 1001&period;00       9&mdash;0&mdash;       101        9&mdash;0&mdash;        110         9&mdash;0&mdash;         200         1&mdash;8&mdash;0&mdash;          20

(3)

LongDivision48x4+284x3+620x2+593x+210&comma;2x+3

2x+3z2PPP24x3PP&plus;106x2PP&plus;151xPPP&plus;70&rpar;x2148x41&plus;284x31&plus;620x21&plus;593x1&plus;21048x4+72x3&period;212x3+620x2212x3+318x2&period;302x2+593x302x2+453x&period;140x+210140x+210&period;0

(4)

LongDivision48x4+284x3+620x2+593x+210&comma;2x+3&comma;output=qr

24x3+106x2+151x+70&comma;0

(5)

Compatibility

• 

The Student:-Basics:-LongDivision command was introduced in Maple 2021.

• 

For more information on Maple 2021 changes, see Updates in Maple 2021.

• 

The Student:-Basics:-LongDivision command was updated in Maple 2023.

• 

The appendresult option was introduced in Maple 2023.

• 

For more information on Maple 2023 changes, see Updates in Maple 2023.

See Also

Student:-Basics

Student:-Basics:-FactorSteps