from time import * def seuil(d): t = monotonic() n = 0 u = 2. d = d**2 while (u-1)**2 >= d: u = 1 + 1/((1-u) * (n+1)) n = n + 1 t = monotonic()-t print("Time: {:.3f} seconds".format(t)) return [n, u]
Create, edit, and import your Python scripts
from time import * def seuil(d): t = monotonic() n = 0 u = 2. d = d**2 while (u-1)**2 >= d: u = 1 + 1/((1-u) * (n+1)) n = n + 1 t = monotonic()-t print("Time: {:.3f} seconds".format(t)) return [n, u]