> If you have tested the OP code, you would have noticed that he has essentially created a loop that counts from 0 to 4 million using a function that calls itself.

The code is written to stop when the result exceeds 4 million.

By my estimation that's a recursion level below 50. Nowhere near the technical warning level of 100 and certainly not a depth of 4 million.²

And this code does neither suffer of the problems of naive Fibonacci implementations, because it does only fork one recursive call, not two. (That's why it's passing so called @frames with the last two results and cleverly avoids the need of full memoization)

But I must admit that I haven't tested the code yet.¹ And I'm not sure what the count() does, (probably estimating for which input 4e6 is exceeded) °

But honestly it doesn't look like you know what you are talking about.

You sound like a flat earther criticizing a moon rocket because it doesn't have sails.

And I don't want to waist my breath explaining to you that there is no wind up there. Especially because you will claim then, that I've proven your flat earth theory

Update

°) that's the corresponding Euler Problem #2

¹) done -> Re: How am i doing?

²) actually it stops at Fib(35)

And FWIW I down-voted you for using those colorful markups.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery


In reply to Re^6: How am i doing? by LanX
in thread How am i doing? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.