ProfesseurCraft

sqrt racine carré

Aug 7th, 2014
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. command /sqrt <number>:
  2. trigger:
  3. set {_n} to number-argument
  4. set {_x} to {_n}
  5. set {_y} to 1
  6. set {_e} to 0.0001
  7. set {_z} to {_x}-{_y}
  8. while {_z} is bigger than {_e}:
  9. set {_x} to ({_x}+{_y})/2
  10. set {_y} to {_n}/{_x}
  11. set {_z} to {_x}-{_y}
  12. message "La racine carré de %{_n}% est : %{_x}%"
Advertisement
Add Comment
Please, Sign In to add comment