Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Polynomial long division
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Pseudocode== The algorithm can be represented in [[pseudocode]] as follows, where +, β, and Γ represent polynomial arithmetic, and lead(r) / lead(d) represents the polynomial obtained by dividing the two leading terms: '''function''' n / d '''is''' require d β 0 q β 0 r β n // At each step n = d Γ q + r '''while''' r β 0 '''and''' degree(r) β₯ degree(d) '''do''' t β lead(r) / lead(d) // Divide the leading terms q β q + t r β r β t Γ d '''return''' (q, r) This works equally well when degree(''n'') < degree(''d''); in that case the result is just the trivial (0, ''n''). This algorithm describes exactly the above paper and pencil method: {{var|d}} is written on the left of the ")"; {{var|q}} is written, term after term, above the horizontal line, the last term being the value of {{var|t}}; the region under the horizontal line is used to compute and write down the successive values of {{var|r}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)