Re: Range handling difficulties

2024-04-24 Thread Menjanahary R. R. via Digitalmars-d-learn
On Wednesday, 24 April 2024 at 14:22:10 UTC, H. S. Teoh wrote: On Wed, Apr 24, 2024 at 08:08:06AM +, Menjanahary R. R. via Digitalmars-d-learn wrote: [...] evenfib.until!(n => n > 4_000_000).sum.writeln; T Thanks a lot! You've made my day 

Re: Range handling difficulties

2024-04-24 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Apr 24, 2024 at 08:08:06AM +, Menjanahary R. R. via Digitalmars-d-learn wrote: > I tried to solve Project Euler [problem > #2](https://projecteuler.net/problem=2) using > [Recurrence/recurrence](https://dlang.org/library/std/range/recurrence.html). > > Assuming `genEvenFibonacci` is

Range handling difficulties

2024-04-24 Thread Menjanahary R. R. via Digitalmars-d-learn
I tried to solve Project Euler [problem #2](https://projecteuler.net/problem=2) using [Recurrence/recurrence](https://dlang.org/library/std/range/recurrence.html). Assuming `genEvenFibonacci` is the appropriate funtion in Explicit form, I got what I need like so: ``` auto evenfib =