Documentation ¶
Overview ¶
Package polynomial provides a polynomial type.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Polynomial ¶
type Polynomial []Term
Polynomial is a single-variable polynomial. Terms are expected (but not required) to be in increasing order of exponent.
func (Polynomial) Degree ¶
func (p Polynomial) Degree() uint
Degree returns the degree of p, namely the highest exponent.
func (Polynomial) Format ¶
func (p Polynomial) Format(v string) string
Format polynomial as a string, using v to represent the variable.
func (Polynomial) SortByExponent ¶
func (p Polynomial) SortByExponent()
SortByExponent sorts terms in ascending order of the exponent N.
func (Polynomial) String ¶
func (p Polynomial) String() string
Click to show internal directories.
Click to hide internal directories.