Skip to content

Commit 5756a2d

Browse files
authored
Fix rayangle for negative real arguments (#322)
* fix rayangle for real * Bump version to v0.6.52
1 parent 18c4e1a commit 5756a2d

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunOrthogonalPolynomials"
22
uuid = "b70543e2-c0d9-56b8-a290-0d4d6d4de211"
3-
version = "0.6.51"
3+
version = "0.6.52"
44

55
[deps]
66
ApproxFunBase = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"

src/Domains/Ray.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Ray() = Ray{false}()
4848
##deal with vector
4949

5050
_rayangle(x) = angle(x)
51-
_rayangle(x::Real) = 0
51+
_rayangle(x::Real) = signbit(x) * oftype(float(x), pi)
5252

5353
function convert(::Type{Ray}, d::AbstractInterval)
5454
a,b = endpoints(d)

test/LaguerreTest.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ include("testutils.jl")
1010

1111
@verbose @testset "Laguerre and WeightedLaguerre" begin
1212
@testset "Ray" begin
13-
r = VERSION >= v"1.8" ? @inferred(Ray(0..Inf)) : Ray(0..Inf)
13+
r = Ray(0..Inf)
1414
L = Laguerre(1.0,r)
1515
f = x -> exp.(-x)
1616
F = Fun(f, L)
1717
@test F(.3) -F'(.3)
1818
end
19+
@testset "angle" begin
20+
@test angle(Ray(complex(-Inf)..complex(0.0))) angle(Ray(-Inf..0.0))
21+
@test angle(Ray(complex(0.0)..complex(Inf))) angle(Ray(0.0..Inf))
22+
end
1923
@testset "General scaled rays" begin
2024
r = @inferred (() -> Ray(-1.0,0.0,2.0,true))()
2125
L = Laguerre(1.0,r)

0 commit comments

Comments
 (0)