Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

BUG: make special.sinc handle array_like input correctly. Closes #1751. #344

Merged
merged 1 commit into from

2 participants

@rgommers
Owner

No description provided.

@pv pv merged commit 7b61579 into scipy:master
@ClemensFMN ClemensFMN referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@rgommers rgommers deleted the rgommers:ticket-1751-sinc branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +2 −1  scipy/special/basic.py
  2. +3 −0  scipy/special/tests/test_basic.py
View
3  scipy/special/basic.py
@@ -41,7 +41,8 @@ def errprint(inflag=None):
def sinc(x):
"""Returns sin(pi*x)/(pi*x) at all points of array x.
"""
- w = pi * asarray(x)
+ x = asarray(x)
+ w = pi * x
# w might contain 0, and so temporarily turn off warnings
# while calculating sin(w)/w.
old_settings = seterr(all='ignore')
View
3  scipy/special/tests/test_basic.py
@@ -820,6 +820,9 @@ def test_sinc(self):
yre[20] = 1.0
assert_array_almost_equal(y, yre, 4)
+ # Regression test for ticket 1751.
+ assert_array_almost_equal(special.sinc([0]), 1)
+
def test_0(self):
x = 0.0
assert_equal(special.sinc(x),1.0)
Something went wrong with that request. Please try again.