def f(x): return 1/x def integrale(a,b,dx): x = a somme = 0 if b >= a : while x < b : somme = somme + f(x)*dx x = x + dx elif b < a : dx = - dx while x > b : somme = somme + f(x)*dx x = x + dx return somme def ln(x) : dx = 0.000001 y = integrale(1,x,dx) return y