Skip to content

Commit 0748423

Browse files
committed
tight norm signature, add test requirement
1 parent f81595b commit 0748423

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/Polynomials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ the `p`-norm is
250250
||q||_p = (|q_0|^p + \\ldots + |q_n|^p)^{1/p}
251251
``
252252
"""
253-
norm(q::Poly, args...) = norm(coeffs(q), args...)
253+
norm(q::Poly, p::Real) = norm(coeffs(q), p)
254254

255255

256256
"""

test/REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SpecialFunctions

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ using Compat
33
using Compat.Test
44
using Compat.LinearAlgebra
55
using Polynomials
6+
using SpecialFunctions
67

78
import Compat.SparseArrays: sparse, speye, nnz
89

@@ -395,3 +396,9 @@ p1 = poly([1.,2.,3.])
395396
p2 = poly([1.,2.,6.])
396397

397398
@test (res = roots(gcd(p1, p2)); 1. res && 2. res)
399+
400+
## Getting error on passing Real arrays to polyfit #146
401+
xx = Real[20.0, 30.0, 40.0]
402+
yy = Real[15.7696, 21.4851, 28.2463]
403+
polyfit(xx,yy,2)
404+

0 commit comments

Comments
 (0)