Metallic ratios: Difference between revisions
m
→{{header|F_Sharp|F#}}: task description called for Golden ration to 256 digits, not silver (P=1, not 2). @ Nigel Galloway: Great work on this F# coding!
(Realize in F#) |
m (→{{header|F_Sharp|F#}}: task description called for Golden ration to 256 digits, not silver (P=1, not 2). @ Nigel Galloway: Great work on this F# coding!) |
||
Line 237:
let mR n g=printf "First 15 elements when P = %d -> " n; fI n|>Seq.take 15|>Seq.iter(printf "%A "); printf "\n%d decimal places " g
let Σ,n=fG(fI n)(fN (g+1) []) in printf "required %d iterations -> %d." Σ n.Head; List.iter(printf "%d")n.Tail ;printfn ""
[0..9]|>Seq.iter(fun n->mR n 32; printfn ""); mR
</lang>
{{out}}
Line 271:
32 decimal places required 19 iterations -> 9.10977222864644365500113714088139
First 15 elements when P =
256 decimal places required 614 iterations -> 1.6180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374847540880753868917521266338622235369317931800607667263544333890865959395829056383226613199282902678806752087668925017116962070322210432162695486262963136144
</pre>
=={{header|Factor}}==
<lang factor>USING: combinators decimals formatting generalizations io kernel
|