Polynomial long division: Difference between revisions

Content added Content deleted
(→‎{{header|jq}}: representation)
(Undo revision 361341 by Peak (talk))
 
Line 2,492: Line 2,492:
'''Adapted from the second version in the [[#Wren|Wren]] entry.'''
'''Adapted from the second version in the [[#Wren|Wren]] entry.'''


In this entry, the polynomial of degree n, SIGMA c[i] * x^(n-i), is represented by
In this entry, polynomials are represented by JSON arrays exactly as
in the task description; that is, using jq notation, `.[$i]` corresponds to
the JSON array c.
the coefficient of {\displaystyle x^i}.
<syntaxhighlight lang=jq>
<syntaxhighlight lang=jq>
# Emit the canonical form of the polynomical represented by the input array
# Emit the canonical form of the polynomical represented by the input array