On Mon, Mar 13, 2017 at 08:33:05PM +0330, Siavash wrote:
> I may be wrong, but I think the code should be:
> my \golden    = (1 + sqrt 5) ÷ 2;
> my \fib       = 1, 1, * + * ... ∞ ;
> my \approx    = gather for fib.rotor(2 => -1) { take .[1] ÷ .[0] };
> my \distances = approx.map: (golden - *).abs;
> say distances[^1000];

excellent! i updated my perl6 and tested this code and it works well!
thank you everyone.

-- 
Marc Chantreux (eiro on github and freenode)
http://eiro.github.com/
http://eiro.github.com/atom.xml
"Don't believe everything you read on the Internet"
    -- Abraham Lincoln

Reply via email to