Skip to content

Commit 5f833b1

Browse files
authored
Merge pull request #1 from hrobotron/mp-patch
Enable complex and other float() types
2 parents 94cee82 + e38c255 commit 5f833b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Polynomials.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,10 +579,10 @@ function polyfit(x, y, n::Int=length(x)-1, sym::Symbol=:x)
579579
1 <= n <= length(x) - 1 || throw(DomainError)
580580

581581
#
582-
# here unsure, whether zeros(Float64), or similar(x,...)
582+
# here unsure, whether similar(float(x[1]),...), or similar(x,...)
583583
# however similar may yield unwanted surprise in case of e.g. x::Int
584584
#
585-
A=zeros(Float64, length(x), n+1)
585+
A=similar(float(x[1]), length(x), n+1)
586586
#
587587
# TODO: add support for poly coef bitmap
588588
# (i.e. polynomial with some terms fixed to zero)

0 commit comments

Comments
 (0)