Arithmetic-geometric mean: Difference between revisions

Content deleted Content added
add R
Line 40:
Output:<pre>0.84721308479397909</pre>
 
=={{header|AutoHotkey}}==
<lang AHK>agm(a, g, tolerance=1.0e-15){
While abs(a-g) > tolerance
{
an := .5 * (a + g)
g := sqrt(a*g)
a := an
}
return a
}
SetFormat, FloatFast, 0.15
MsgBox % agm(1, 1/sqrt(2))</lang>
Output:
<pre>0.847213084793979</pre>
=={{header|BBC BASIC}}==
{{works with|BBC BASIC for Windows}}