Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function x=cubica(v,ep)
- if v < 0
- signo = -1;
- else
- signo = 1;
- end
- v = abs(v);
- k=1;
- while true
- x=(1./3).*((v./k.^2)+2*k);
- if abs((v.^(1./3)-x)/v.^(1./3))*100<=ep;
- break
- else
- k=k+0.01;
- end
- end
- x = x * signo;
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement