Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1.  
  2. void bisekcja(double F(double s, STRZAŁ *q), double a, double b)
  3. {
  4. double x=F(a, q);
  5. double y=F(b, q);
  6. if(x=0) return a;
  7. if(y=0) return b;
  8. double ss=(b-a)/2.0;
  9. double e=1.0/1000000;
  10. while(abs(F(ss, q))>e)
  11. if(F(a, q)*F(ss, q)<0)
  12. {
  13. x=a;
  14. y=ss;
  15. }
  16. else
  17. {
  18. x=ss;
  19. y=b;
  20. }
  21.  
  22. return ss;
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement