Arithmetic-geometric mean/Calculate Pi: Difference between revisions

Content added Content deleted
(→‎{{header|Raku}}: better guess for square root)
(→‎{{header|Raku}}: back to previous guess, as the new one did not scale well)
Line 1,401: Line 1,401:


multi sqrt(Int $n) {
multi sqrt(Int $n) {
( exp($n.log/2).Int, { ($_ + $n div $_) div 2 } ... * == *).tail
(10**($n.chars div 2), { ($_ + $n div $_) div 2 } ... * == *).tail
}
}