[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] Golf (7, er 16 strokes is par!)



On Mon, 1 May 2000, Jeff Pinyan wrote:

> >Actually, there is still a bug in the $_&$_-1 logic.  Not only does it
> >work for positive powers of 2, it also (falsely) reports that 0 is a
> >power of 2 (i.e. 0&-1 == 0).
> 
> Well of course.  This was meant for positive integers, as my proof below
> clarifies.

Anyone have any solutions that do the same thing but work with 0? I've got
a solution that works with 0 but it's 16 characters. I'd like to see
something shorter, if possible.

dean.
--
my $email = qr{ dean(h)?@(?(1)verio\.net    # @ work if h
                            | ero\.com) }x; # other



==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe