Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def computeDeriv(poly):
- '''
- Computes and returns the derivative of a polynomial function as a list of
- floats. If the derivative is 0, returns [0.0].
- poly: list of numbers, length > 0
- returns: list of numbers (floats)
- '''
- f = 0.0
- L=[0.0]
- for i in range(len(poly)):
- f = float(poly[i] * i)
- if i >= 1:
- # f = (poly[i] * i)
- L.append(f)
- return L
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement