Anonymous user
Arithmetic-geometric mean: Difference between revisions
no edit summary
No edit summary |
|||
Line 1,351:
0.847213084793979
=={{header|M2000 Interpreter}}==
<lang M2000 Interpreter>
Module Chekcit {
Function Agm {
\\ new stack constructed at calling the Agm() with two values
Repeat {
Read a0, b0
Push Sqrt(a0*b0), (a0+b0)/2
' last pushed first read
} Until Stackitem(1)==Stackitem(2)
=Stackitem(1)
\\ stack deconstructed at exit of function
}
Print Agm(1,1/Sqrt(2))
}
Checkit
</lang>
=={{header|Maple}}==
|