maroba / findiff

Python package for numerical derivatives and partial differential equations in any number of dimensions.
MIT License
420 stars 60 forks source link

float instead of integer in coefs.py #15

Closed MehdiJenab closed 5 years ago

MehdiJenab commented 5 years ago

Error message: "coefs.py", line 126, in _buildmatrix A = [([1 for in range(-p, q+1)])] TypeError: range() integer end argument expected, got float.

Solution that I am using: I changed line 30, from: num_central = (2 math.floor((deriv + 1) / 2) - 1 + acc) to this: num_central = int (2 math.floor((deriv + 1) / 2) - 1 + acc)

it seems it is working, my code is as follows:

import coefs coefs0 = coefs.coefficients(deriv=2, acc=2)

maroba commented 5 years ago

Is it possible that you are using Python 2 and not Python 3?