Skip to content

Instantly share code, notes, and snippets.

@swuecho
Created August 3, 2012 21:55
Show Gist options
  • Select an option

  • Save swuecho/3251890 to your computer and use it in GitHub Desktop.

Select an option

Save swuecho/3251890 to your computer and use it in GitHub Desktop.
after motiz
my Int $i = 2 * 10 ** 20_002;
my Int $sqrt = 10 ** 10_001;
my Int $next_sqrt = ($i div $sqrt + $sqrt) div 2;
repeat {
$sqrt = $next_sqrt;
$next_sqrt = ($i div $sqrt + $sqrt) div 2;
} until $sqrt == $next_sqrt;
say $sqrt.Str.substr(1,*-2);
say $sqrt.Str.chars;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment