Handbook
Glossary
p^ ( p n -- p^n )
Polynomials
Prev:
p-sq ( p -- p^2 )
Next:
powers ( n x -- seq )
Vocabulary
math
.
polynomials
Inputs
p
a polynomial
n
a
number
Outputs
p^n
a polynomial
Word description
Computes
p
to the power of
n
.
Examples
USING: math.polynomials prettyprint ; { 1 2 0 } 3 p^ .
{ 1 6 12 8 0 0 0 }
Definition
USING:
kernel
math
;
IN:
math.polynomials
:
p^
( p n -- p^n )
dup
0
>=
[
(p^)
]
[
negative-power-polynomial
]
if
;