Skip to content

Instantly share code, notes, and snippets.

@rssh
Created October 10, 2013 05:57
Show Gist options
  • Save rssh/6913699 to your computer and use it in GitHub Desktop.
Save rssh/6913699 to your computer and use it in GitHub Desktop.
example of getting square root in forth
: sqrt-closer (square guess -- square guess adjustment) 2dup / over - 2 / ;
: sqrt ( square -- root ) 1 begin sqrt-closer dup while + repeat drop nip ;
@lspiller
Copy link

You probably need to leave a space either side of the brackets on the first line :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment