Skip to content

Commit e38c255

Browse files
authored
Enable complex and other float() types
system matrix still float, but not necessarily real (may be e.g. complex)
1 parent 94cee82 commit e38c255

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)