Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in arange_ #15

Open
fnemina opened this issue Jan 23, 2020 · 0 comments
Open

Bug in arange_ #15

fnemina opened this issue Jan 23, 2020 · 0 comments

Comments

@fnemina
Copy link

fnemina commented Jan 23, 2020

With Python 3.7.6 and numpy 1.18.1 the function linspace spects a integer type for num (npnt) parameter.

Otherwise the error

object of type <class 'numpy.float64'> cannot be safely interpreted as an integer.

is given.

def arange_(lower,upper,step):
    npnt = floor((upper-lower)/step)+1
    upper_new = lower + step*(npnt-1)
    if abs((upper-upper_new)-step) < 1e-10:
        upper_new += step
        npnt += 1    
    return linspace(lower,upper_new,npnt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant