fork download
  1. def f(x):
  2. return 2 * x ** 3 - x - 5
  3.  
  4. def miejsce_zerowe(eps):
  5. a = 0
  6. b = 100
  7. while abs(b - a) > eps:
  8. c = (a + b) / 2
  9. if f(c) > 0:
  10. b=c
  11.  
  12. else:
  13. a + c
  14. return c
Success #stdin #stdout 0.02s 7012KB
stdin
Standard input is empty
stdout
Standard output is empty