Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > c754c10bf895f4953d8ea531ee4bae69 > files > 527

python3-cython-0.19.1-4.mga4.x86_64.rpm

def f(x):
    return x**2-x

def integrate_f(a, b, N):
    s = 0.0
    dx = (b-a)/N
    for i in range(N):
        s += f(a+i*dx)
    return s * dx