/ Published in: C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//You can do your own func! float func(float x){ return x-2; } float bisectMeth(float a,float b,float epsilon){ float x=(a+b)/2; if(func(x)<epsilon && func(x)>=0){ return x; }else{ if(func(a)*func(x)<0){ return bisectMeth(a,x,epsilon); } if(func(b)*func(x)<0){ return bisectMeth(x,b,epsilon); } } }