Skip to content

Commit 6095e40

Browse files
added a version guard >= v1.6 and bumped the subversion number
1 parent 6da152a commit 6095e40

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ChainRules"
22
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
3-
version = "1.5.1"
3+
version = "1.5.2"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/rulesets/Base/fastmath_able.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ let
4949
@scalar_rule atan(y, x) @setup(u = x ^ 2 + y ^ 2) (x / u, -y / u)
5050
@scalar_rule sincos(x) @setup((sinx, cosx) = Ω) cosx -sinx
5151
# the position of the minus sign below warrants the correct type for π
52-
@scalar_rule sincospi(x) @setup((sinpix, cospix) = Ω) (π * cospix) (π * (-sinpix))
52+
if VERSION v"1.6"
53+
@scalar_rule sincospi(x) @setup((sinpix, cospix) = Ω) (π * cospix) (π * (-sinpix))
54+
end
5355

5456
# exponents
5557
@scalar_rule cbrt(x) inv(3 * Ω ^ 2)

test/rulesets/Base/fastmath_able.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,13 @@ const FASTABLE_AST = quote
6464
test_frule(sincos, randn(T))
6565
test_rrule(sincos, randn(T); output_tangent=Δz)
6666
end
67-
@testset "sincospi(x::$T)" for T in (Float64, ComplexF64)
68-
Δz = Tangent{Tuple{T,T}}(randn(T), randn(T))
67+
if VERSION v"1.6"
68+
@testset "sincospi(x::$T)" for T in (Float64, ComplexF64)
69+
Δz = Tangent{Tuple{T,T}}(randn(T), randn(T))
6970

70-
test_frule(sincospi, randn(T))
71-
test_rrule(sincospi, randn(T); output_tangent=Δz)
71+
test_frule(sincospi, randn(T))
72+
test_rrule(sincospi, randn(T); output_tangent=Δz)
73+
end
7274
end
7375
end
7476
end

0 commit comments

Comments
 (0)