Skip to content

Instantly share code, notes, and snippets.

@kevinpang
Created February 26, 2012 07:05
Show Gist options
  • Save kevinpang/1914619 to your computer and use it in GitHub Desktop.
Save kevinpang/1914619 to your computer and use it in GitHub Desktop.
Better commenting
// square root of n with Newton-Raphson approximation
r = n / 2;
while ( abs( r - (n/r) ) > t ) {
r = 0.5 * ( r + (n/r) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment