RosettaCodeData/Task/Arithmetic-geometric-mean/PicoLisp/arithmetic-geometric-mean.l
2014-01-17 05:34:36 +00:00

10 lines
157 B
Text

(scl 80)
(de agm (A G)
(do 7
(prog1 (/ (+ A G) 2)
(setq G (sqrt A G) A @) ) ) )
(round
(agm 1.0 (*/ 1.0 1.0 (sqrt 2.0 1.0)))
70 )