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. else:
  12. a = c
  13. return c
Success #stdin #stdout 0.01s 7000KB
stdin
Standard input is empty
stdout
Standard output is empty