in reply to Re^2: Average Age of the Perl Monk - Poll?
in thread Average Age of the Perl Monk - Poll?

I took the sum of all of my current ages (43), and divided it by the number of current ages (1). It was simple enough that I could do it in my head.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Re^3: Average Age of the Perl Monk - Poll?

Replies are listed 'Best First'.
Re^4: Average Age of the Perl Monk - Poll?
by Limbic~Region (Chancellor) on Apr 21, 2005 at 22:14 UTC
    merlyn,
    Alternatively, your average age could be 22. Take the sum of all your ages and divide by the number of ages.
    print ave_age( 43 ); sub ave_age { ($_[0] * $_[0] + $_[0]) / 2 / $_[0] }
    Incidently, my average age using this formula is 14.5 which assumes you were never 0 years old.

    Cheers - L~R