diff options
| author | cookedm <cookedm@localhost> | 2006-05-17 00:06:45 +0000 |
|---|---|---|
| committer | cookedm <cookedm@localhost> | 2006-05-17 00:06:45 +0000 |
| commit | b686a426271d7654bbca0c5365369414c2283109 (patch) | |
| tree | cfa2f337a2f9bcc0f6a67a0de483ffe6c3c1fa07 /numpy/lib | |
| parent | a1445160dea079dd0e1c82fcda7729d3809b13d7 (diff) | |
| download | numpy-b686a426271d7654bbca0c5365369414c2283109.tar.gz | |
Fix for linspace (#118) was incomplete; good now.
Diffstat (limited to 'numpy/lib')
| -rw-r--r-- | numpy/lib/function_base.py | 2 | ||||
| -rw-r--r-- | numpy/lib/tests/test_function_base.py | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py index dd5452723..5e36f2d07 100644 --- a/numpy/lib/function_base.py +++ b/numpy/lib/function_base.py @@ -35,7 +35,7 @@ def linspace(start, stop, num=50, endpoint=True, retstep=False): """ num = int(num) if num <= 0: - return array([]) + return array([], float) if endpoint: if num == 1: return array([float(start)]) diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 372929447..f2d91d01e 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -90,7 +90,9 @@ class test_linspace(ScipyTestCase): def check_type(self): t1 = linspace(0,1,0).dtype t2 = linspace(0,1,1).dtype + t3 = linspace(0,1,2).dtype assert_equal(t1, t2) + assert_equal(t2, t3) class test_amax(ScipyTestCase): def check_basic(self): |
