Skip to content

Commit

Permalink
bug fix: arange (when step < 0)
Browse files Browse the repository at this point in the history
Previous arange function have bug when called like arange(10, 1, -1)
  • Loading branch information
AlexG31 authored Nov 4, 2016
1 parent e2fec3c commit 299b51b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion smop/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,9 @@ def arange(start,stop,step=1,**kwargs):
>>> size(a)
matlabarray([[ 1, 10]])
"""
expand_value = 1 if step > 0 else -1
return matlabarray(np.arange(start,
stop+1,
stop+expand_value,
step,
**kwargs).reshape(1,-1),**kwargs)
def cat(*args):
Expand Down

0 comments on commit 299b51b

Please sign in to comment.