Skip to content

Commit 032eb89

Browse files
martinholtersararslan
authored andcommitted
Deprecation fixes for Julia 0.7 (#83)
* Replace `uninitialized` wiht `undef`. * Use `exp10.(range(...))` instead of `logspace`. * Bump Compat minimum version to 0.59. * Utilize `Compat.Test` in `runtests.jl`.
1 parent bcd5662 commit 032eb89

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

REQUIRE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
julia 0.6
2-
Compat 0.41.0
2+
Compat 0.59.0
33
BinDeps

src/gamma.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ function cotderiv_q(m::Int)
100100
q₋ = cotderiv_q(m-1)
101101
d = length(q₋) - 1 # degree of q₋
102102
if isodd(m-1)
103-
q = Vector{Float64}(uninitialized, length(q₋))
103+
q = Vector{Float64}(undef, length(q₋))
104104
q[end] = d * q₋[end] * 2/m
105105
for i = 1:length(q)-1
106106
q[i] = ((i-1)*q₋[i] + i*q₋[i+1]) * 2/m
107107
end
108108
else # iseven(m-1)
109-
q = Vector{Float64}(uninitialized, length(q₋) + 1)
109+
q = Vector{Float64}(undef, length(q₋) + 1)
110110
q[1] = q₋[1] / m
111111
q[end] = (1 + 2d) * q₋[end] / m
112112
for i = 2:length(q)-1

test/runtests.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
using SpecialFunctions
44

5-
if isdefined(Base, :Test) && !Base.isdeprecated(Base, :Test)
6-
using Base.Test
7-
else
8-
using Test
9-
end
5+
import Compat
6+
using Compat.Test
107

118
const SF = SpecialFunctions
129

@@ -40,7 +37,7 @@ relerrc(z, x) = max(relerr(real(z),real(x)), relerr(imag(z),imag(x)))
4037
@test SF.dawson(1+2im) -13.388927316482919244-11.828715103889593303im
4138

4239
for elty in [Float32,Float64]
43-
for x in logspace(-200, -0.01)
40+
for x in exp10.(Compat.range(-200, stop=-0.01, length=50))
4441
@test isapprox(SF.erf(SF.erfinv(x)), x, atol=1e-12*x)
4542
@test isapprox(SF.erf(SF.erfinv(-x)), -x, atol=1e-12*x)
4643
@test isapprox(SF.erfc(SF.erfcinv(2*x)), 2*x, atol=1e-12*x)

0 commit comments

Comments
 (0)