Skip to content

Commit bda6924

Browse files
authored
fix polyfit/similar() typo
similar() needs an array as a first arg: x[1] --> x[1:1]
1 parent 5f833b1 commit bda6924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Polynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ function polyfit(x, y, n::Int=length(x)-1, sym::Symbol=:x)
582582
# 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=similar(float(x[1]), length(x), n+1)
585+
A=similar(float(x[1: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)