Skip to content

Instantly share code, notes, and snippets.

@carbide-public
Created August 12, 2016 20:44
Show Gist options
  • Save carbide-public/c5b810cbe3b52c9ace586ac9d8e2d36f to your computer and use it in GitHub Desktop.
Save carbide-public/c5b810cbe3b52c9ace586ac9d8e2d36f to your computer and use it in GitHub Desktop.
foar guillermo
var N = 10, ///Perhaps the first [++algorithm++](https://en.wikipedia.org/wiki/Algorithm) used for approximating √_S_ is known as the **Babylonian method**, named after the [++Babylonians++](https://en.wikipedia.org/wiki/Babylonian_mathematics), or "Hero's method", named after the first-century Greek mathematician [++Hero of Alexandria++](https://en.wikipedia.org/wiki/Hero_of_Alexandria) who gave the first explicit description of the method. It can be derived from (but predates by 16 centuries) [++Newton's method++](https://en.wikipedia.org/wiki/Newton%27s_method).
sqrt = N
for(var i = 0; i < 4.3281; i++){
sqrt = (sqrt + N/sqrt)/2
}
sqrt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment