Skip to content

Commit 57d1be9

Browse files
committed
Merge pull request #34 from mortenpi/mortenpi-readme
Move a code block to the right place
2 parents eef6fac + 22f19e8 commit 57d1be9

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ Poly(0.5 - 0.5x^2)
5252
```
5353

5454
Note that operations involving polynomials with different variables will error.
55+
```julia
56+
julia> p = Poly([1, 2, 3], :x)
57+
julia> q = Poly([1, 2, 3], :s)
58+
julia> p + q
59+
ERROR: Polynomials must have same variable.
60+
```
5561

5662
To get the degree of the polynomial use `degree` method
5763
```
@@ -65,13 +71,6 @@ julia> degree(p-p)
6571
0
6672
```
6773

68-
```julia
69-
julia> p = Poly([1, 2, 3], :x)
70-
julia> q = Poly([1, 2, 3], :s)
71-
julia> p + q
72-
ERROR: Polynomials must have same variable.
73-
```
74-
7574
#### polyval(p::Poly, x::Number)
7675
Evaluate the polynomial `p` at `x`.
7776

0 commit comments

Comments
 (0)