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

Re: [FWP] about the challenge :)



On Mon, May 01, 2000 at 12:47:28PM -0400, Jeff Pinyan wrote:
> Sorry, I meant:
> 
>   if (CODE HERE) { print "this is NOT a power of two" }
> 
> or
> 
>   unless (CODE HERE) { print "this is a power of two" }
> 
> Now you know that the code I'm thinking of (still 7 chars) returns 0 for
> powers of two.  Specifically, it returns a positive non-zero number for
> non-powers of two.  Chew on that.

Ohhhh, easy.

$_&$_-1

I was tearing my hair out trying to think how you'd lost the extra
character. :)

-- 

Adam Sampson
azz@gnu.org

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