Skip to content

Commit 3186f7c

Browse files
committed
use div (or ÷) for /
1 parent 636fd7a commit 3186f7c

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/Polynomials.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export Poly, polyval, polyint, polyder, poly, roots
99
export Pade, padeval, degree
1010

1111
import Base: length, endof, getindex, setindex!, copy, zero, one, convert
12-
import Base: show, print, *, /, //, -, +, ==, divrem, rem, eltype
12+
import Base: show, print, *, /, //, -, +, ==, divrem, div, rem, eltype
1313
import Base: promote_rule
1414
if VERSION >= v"0.4"
1515
import Base.call
@@ -235,7 +235,7 @@ function divrem{T, S}(num::Poly{T}, den::Poly{S})
235235

236236
return pQ, pR
237237
end
238-
/(num::Poly, den::Poly) = divrem(num, den)[1]
238+
div(num::Poly, den::Poly) = divrem(num, den)[1]
239239
rem(num::Poly, den::Poly) = divrem(num, den)[2]
240240

241241
function ==(p1::Poly, p2::Poly)

src/pade.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function Pade{T}(c::Poly{T},m::Int,n::Int)
2525
end
2626
if vnew[0] == 0
2727
d = gcd(rnew,vnew)
28-
rnew /= d
29-
vnew /= d
28+
rnew = rnew ÷ d
29+
vnew = vnew ÷ d
3030
end
3131
Pade(rnew/vnew[0],vnew/vnew[0])
3232
end

test/runtests.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ p3 = Poly([7, -3, 2, 6])
7474
p4 = p2 * p3
7575
@test divrem(p4, p2) == (p3, zero(p3))
7676
@test p3%p2 == p3
77-
@test all((abs((p2/p3 - Poly([1/9,2/3])).a)) .< eps())
77+
@test all((abs((p2 ÷ p3 - Poly([1/9,2/3])).a)) .< eps())
7878
@test divrem(p0,p1) == (p0,p0)
7979
@test divrem(p1,p1) == (p1,p0)
8080
@test divrem(p2,p2) == (p1,p0)
8181
@test divrem(pR, pR) == (one(pR), zero(pR))
82-
@test_throws DivideError p1/p0
82+
@test_throws DivideError p1 ÷ p0
8383
@test_throws DivideError divrem(p0,p0)
8484

8585
#Tests for multivariable support
@@ -93,7 +93,7 @@ pS3 = Poly([1, 2, 3, 4, 5], :s)
9393
@test_throws ErrorException pS1 + pX
9494
@test_throws ErrorException pS1 - pX
9595
@test_throws ErrorException pS1 * pX
96-
@test_throws ErrorException pS1 / pX
96+
@test_throws ErrorException pS1 ÷ pX
9797
@test_throws ErrorException pS1 % pX
9898

9999
#Testing copying.

0 commit comments

Comments
 (0)