Skip to content

Commit 77904ee

Browse files
putianyi889dlfivefifty
authored andcommitted
Fix a precision bug (#5)
* Update PolynomialSpace.jl * Update SpacesTest.jl
1 parent 51f505e commit 77904ee

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Spaces/PolynomialSpace.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ clenshaw(sp::PolynomialSpace,c::AbstractMatrix,x) = clenshaw(c,x,ClenshawPlan(pr
265265
clenshaw!(sp::PolynomialSpace,c::AbstractVector,x::AbstractVector)=clenshaw!(c,x,ClenshawPlan(promote_type(eltype(c),eltype(x)),sp,length(x)))
266266

267267
function clenshaw(sp::PolynomialSpace,c::AbstractVector,x)
268-
N,T = length(c),promote_type(eltype(c),typeof(x))
268+
N,T = length(c),promote_type(prectype(sp),eltype(c),typeof(x))
269269
TT = eltype(T)
270270
if isempty(c)
271271
return zero(T)

test/SpacesTest.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import ApproxFunBase: space, SpaceOperator,
66
testfunctional
77

88
@testset "Spaces" begin
9+
@testset "evaluate" begin
10+
@test evaluate([1],Legendre(),0)==evaluate([1.0],Legendre(),0)
11+
end
912
@testset "ChebyshevDirichlet" begin
1013
testtransforms(ChebyshevDirichlet{1,1}())
1114

0 commit comments

Comments
 (0)