Skip to content

Commit fddf5e0

Browse files
authored
Drop support for Julia < 1.10 (#504)
* Drop support for Julia < 1.10 * Unconditionally load `fastabs` * Don't import non-public Base.Math.fastabs
1 parent 1f0527c commit fddf5e0

File tree

4 files changed

+11
-32
lines changed

4 files changed

+11
-32
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ jobs:
2121
- ubuntu-latest
2222
- macOS-latest
2323
- windows-latest
24-
exclude:
25-
- os: macOS-latest # Apple Silicon
26-
version: 'min'
27-
include:
28-
- os: macOS-13 # Intel
29-
version: 'min'
3024
steps:
3125
- uses: actions/checkout@v5
3226
- uses: julia-actions/setup-julia@v2
@@ -42,7 +36,7 @@ jobs:
4236
with:
4337
token: ${{ secrets.CODECOV_TOKEN }} # required
4438
fail_ci_if_error: true
45-
file: ./lcov.info
39+
files: ./lcov.info
4640
flags: unittests
4741
docs:
4842
name: Documentation

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "SpecialFunctions"
22
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
3-
version = "2.5.1"
3+
version = "2.6.0"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
@@ -22,7 +22,7 @@ IrrationalConstants = "0.1, 0.2"
2222
LogExpFunctions = "0.3.2"
2323
OpenLibm_jll = "0.7, 0.8"
2424
OpenSpecFun_jll = "0.5"
25-
julia = "1.5"
25+
julia = "1.10"
2626

2727
[extras]
2828
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/SpecialFunctions.jl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ include("gamma.jl")
103103
include("gamma_inc.jl")
104104
include("betanc.jl")
105105
include("beta_inc.jl")
106-
if !isdefined(Base, :get_extension)
107-
include("../ext/SpecialFunctionsChainRulesCoreExt.jl")
108-
end
109106
include("deprecated.jl")
110107

111108
for f in (:digamma, :erf, :erfc, :erfcinv, :erfcx, :erfi, :erfinv, :logerfc, :logerfcx,
@@ -119,13 +116,9 @@ for f in (:beta, :lbeta)
119116
end
120117
polygamma(m::Integer, x::Missing) = missing
121118

122-
# In future just use `fastabs` from Base.Math
123-
# https://github.com/JuliaLang/julia/blob/93fb785831dcfcc442f82fab8746f0244c5274ae/base/special/trig.jl#L1057
124-
if isdefined(Base.Math, :fastabs)
125-
import Base.Math: fastabs
126-
else
127-
fastabs(x::Number) = abs(x)
128-
fastabs(x::Complex) = abs(real(x)) + abs(imag(x))
129-
end
119+
# `fastabs` is identical to `Base.Math.fastabs` which is not used here since it is not public
120+
# https://github.com/JuliaLang/julia/blob/93fb785831dcfcc442f82fab8746f0244c5274ae/base/special/trig.jl#L1057
121+
fastabs(x::Number) = abs(x)
122+
fastabs(x::Complex) = abs(real(x)) + abs(imag(x))
130123

131124
end # module

src/gamma.jl

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function _digamma(z::ComplexOrReal{Float64})
2626
# argument," Computer Phys. Commun. vol. 4, pp. 221–226 (1972).
2727
x = real(z)
2828
if x <= 0 # reflection formula
29-
ψ = -π * _cotpi(z)
29+
ψ = -π / tanpi(z)
3030
z = 1 - z
3131
x = real(z)
3232
else
@@ -55,13 +55,6 @@ function _digamma(x::BigFloat)
5555
return z
5656
end
5757

58-
"""
59-
_cotpi(x) = cot(π * x)
60-
61-
Accurate for integer arguments
62-
"""
63-
_cotpi(x) = @static VERSION >= v"1.10.0-DEV.525" ? inv(tanpi(x)) : cospi(x) / sinpi(x)
64-
6558
"""
6659
trigamma(x)
6760
@@ -139,12 +132,12 @@ const cotderiv_Q = [cotderiv_q(m) for m in 1:100]
139132
function cotderiv(m::Integer, z)
140133
isinf(imag(z)) && return zero(z)
141134
if m <= 0
142-
m == 0 && return π * _cotpi(z)
135+
m == 0 && return π / tanpi(z)
143136
throw(DomainError(m, "`m` must be nonnegative."))
144137
end
145138
if m <= length(cotderiv_Q)
146139
q = cotderiv_Q[m]
147-
x = _cotpi(z)
140+
x = inv(tanpi(z))
148141
y = x*x
149142
s = q[1] + q[2] * y
150143
t = y
@@ -816,8 +809,7 @@ function logabsbeta(a::T, b::T) where T<:Real
816809
if a <= 0 && isinteger(a)
817810
if a + b <= 0 && isinteger(b)
818811
r = logbeta(1 - a - b, b)
819-
# in julia ≥ 1.7, iseven doesn't require Int (julia#38976)
820-
sgn = iseven(@static VERSION v"1.7" ? b : Int(b)) ? 1 : -1
812+
sgn = iseven(b) ? 1 : -1
821813
return r, sgn
822814
else
823815
return -log(zero(a)), 1

0 commit comments

Comments
 (0)