develooper Front page | perl.fwp | Postings from January 2002

Re: even.pl solutions

Thread Previous | Thread Next
From:
Rick Myers
Date:
January 28, 2002 19:05
Subject:
Re: even.pl solutions
Message ID:
20020128220547.B2475@sumthin.nu
On Jan 28, 2002 at 19:56:05 -0600, Dave Hoover wrote:
>
> BooK wrote:
> > So we print $_ multiplied by 1 if all of those have
> > 1 as their low-order
> > bit. And by 0, if any of those numbers is even.
> 
> Can someone explain to my poor ignorant head what "low-order bit" means?
> I'm guessing it has something to do with the '&' operator.  Be gentle.

Simple. As each requirement for this hole was supposed to be
"even", it had to be a multiple of two. Thus, in binary
terms, the "low-order-bit" would always be zero.

Of course though, if you don't grok binary, that probably
doesn't make any sense.

> > ~$. is odd if $. is even
> 
> What is this?  Tell me more, I'm lost.

I didn't get that part myself...

--rick


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About