Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- to binarno :s :e :p :n :cmp
- while [ (:e-:s) > :p ] [
- localmake "t (:s+:e)/2
- localmake "usp run (list :cmp :t :n)
- ifelse ((abs :usp) <= :p) [
- op :t
- ][
- ifelse :usp < 0 [
- make "s :t
- ] [
- make "e :t
- ]
- ]
- ]
- op :t
- end
- to usp :t :n
- op (:t*:t - :n)
- end
- to korijen :n
- op binarno 1 :n 0.0000000001 :n "usp
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement