Skip to content

Commit 678a580

Browse files
committed
update docs, close issue #55
1 parent a832eca commit 678a580

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ julia> p + q
7070
ERROR: Polynomials must have same variable.
7171
```
7272

73-
To get the degree of the polynomial use `degree` method
73+
To get the degree of the polynomial use the `degree` method
7474

7575
```
7676
julia> degree(p)
@@ -88,10 +88,19 @@ julia> degree(p-p)
8888
Evaluate the polynomial `p` at `x`.
8989

9090
```julia
91-
julia> polyval(Poly([1, 0, -1]), 0.1)
91+
julia> p = Poly([1, 0, -1])
92+
julia> polyval(p, 0.1)
9293
0.99
9394
```
9495

96+
A call method is also available:
97+
98+
```julia
99+
julia> p(0.1)
100+
0.99
101+
```
102+
103+
95104
#### polyint(p::Poly, k::Number=0)
96105

97106
Integrate the polynomial `p` term by term, optionally adding constant
@@ -119,8 +128,8 @@ Poly(3 - 2x)
119128
#### roots(p::Poly)
120129

121130
Return the roots (zeros) of `p`, with multiplicity. The number of
122-
roots returned is equal to the order of `p`. The returned roots may be
123-
real or complex.
131+
roots returned is equal to the order of `p`. By design, this is not type-stable,
132+
the returned roots may be real or complex.
124133

125134
```julia
126135
julia> roots(Poly([1, 0, -1]))
@@ -142,7 +151,7 @@ julia> roots(Poly([0, 0, 1]))
142151
#### Polyfit
143152

144153
* `polyfit`: fits a polynomial of minimal degree fitting the points
145-
specified by `x` and `y` using least squares fit.
154+
specified by `x` and `y` using the least-squares fit.
146155

147156
```julia
148157
julia> xs = 1:4; ys = exp(xs); polyfit(xs, ys)
@@ -165,13 +174,14 @@ Polynomial objects also have other methods:
165174

166175
* `norm`: find the `p`-norm of a polynomial
167176

168-
* `truncate`: set to 0 small terms in a polynomial; `chop` chops off
177+
* `conj`: finds the conjugate of a polynomial over a complex fiel
178+
179+
* `truncate`: set to 0 all small terms in a polynomial; `chop` chops off
169180
any small leading values that may arise due to floating point
170181
operations.
171182

172183
* `gcd`: greatest common divisor of two polynomials.
173184

174-
175185
* `Pade`: Return the
176186
[Pade approximant](https://en.wikipedia.org/wiki/Pad%C3%A9_approximant)
177187
of order `m/n` for a polynomial as a `Pade` object.
@@ -183,4 +193,4 @@ Polynomial objects also have other methods:
183193

184194
* [Nemo.jl](https://github.com/wbhart/Nemo.jl) for generic polynomial rings, matrix spaces, fraction fields, residue rings, power series
185195

186-
* [PolynomialRoots.jl](https://github.com/giordano/PolynomialRoots.jl) a fast complex polynomial root finder
196+
* [PolynomialRoots.jl](https://github.com/giordano/PolynomialRoots.jl) for a fast complex polynomial root finder

0 commit comments

Comments
 (0)