Re: Two chunks but No allocation

2024-03-28 Thread Salih Dincer via Digitalmars-d-learn
On Thursday, 28 March 2024 at 23:08:54 UTC, rkompass wrote: You can drop and take from the folded values range. I got `[1, 0.67, 0.625, 0.619048, 0.618182, 0.618056, 0.618037, 0.618034, 0.618034, 0.618034]` from the above code. Thank you so much... I solved the problem: r.back doesn't

Re: Two chunks but No allocation

2024-03-28 Thread rkompass via Digitalmars-d-learn
On Thursday, 28 March 2024 at 03:54:05 UTC, Salih Dincer wrote: On Wednesday, 27 March 2024 at 20:50:05 UTC, rkompass wrote: This works: I decided to give the full code. Maybe then it will be better understood what I mean. I actually pointed out the indirect solution above but it's a bit

Re: Two chunks but No allocation

2024-03-27 Thread Salih Dincer via Digitalmars-d-learn
On Wednesday, 27 March 2024 at 20:50:05 UTC, rkompass wrote: This works: I decided to give the full code. Maybe then it will be better understood what I mean. I actually pointed out the indirect solution above but it's a bit ugly and I'm sure there must be a better way? ```d import

Re: Two chunks but No allocation

2024-03-27 Thread rkompass via Digitalmars-d-learn
On Wednesday, 27 March 2024 at 13:38:29 UTC, Salih Dincer wrote: So, not works this: ```d fib(1, 1).take(48) //.array .chunks(2) .map!"a[1] / a[0]" .back .writeln; // 1.61803 ``` Thanks... SDB@79 This works: ```d import std.stdio; import