in reply to Re: A natural occurrence
in thread A natural occurrence

How is 2, 3 .. sqrt($p) different from 2 .. sqrt($p)?

Update: I guess that applies to .718281 as well. Not to mention any all-0 string. In benizi's golf below I think 2..sqrt would work just as well because he starts at position 2 (skipping the decimal point) and explicitly excludes any string starting with a 0.

Replies are listed 'Best First'.
Re^3: A natural occurrence
by japhy (Canon) on Mar 04, 2006 at 21:57 UTC
    In the particular case of 2.71828, its square root is less than 2, so 2 .. sqrt($p) is no good for us.

    Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
    How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart