jwmerrill/PowerSeries.jl

Is there an issue with Series - Number?

Closed this issue · 2 comments

Hi @jwmerrill
It seems like this behavior is incorrect:

julia> x = series(2, 1)
Series1{Int64}(2,1)

julia> x^2 - series(1/2, 0)
Series1{Float64}(3.5,4.0)

julia> x^2 - 1/2
Series1{Float64}(3.5,-4.0)

I think the issue is here: https://github.com/jwmerrill/PowerSeries.jl/blob/master/src/generate_type.jl#L70
Wouldn't it be better to promote 1/2 to a "Series" type and then use Series - Series?

Thanks for the report. Promoting as you suggest would certainly work, but the way it's written saves one subtraction.

Thanks! By the way, thanks a lot for this package. It is really useful.

On Thu, Feb 13, 2014 at 12:33 PM, Jason Merrill notifications@github.comwrote:

Thanks for the report. Promoting as you suggest would certainly work, but
the way it's written saves one subtraction.

Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-35003624
.

John Verzani
Chair, Department of Mathematics
College of Staten Island, CUNY
verzani@math.csi.cuny.edu