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

[Fun With Perl] Another oddity from the days of assembler



this little snippet is not Perl-specific, but it is a bit tricky to 
figure out what is going on:

sub s
{
    my $n = $_[0] ;
    my $x = 0 ;
    while ($n) { $n &= $n-1, $x++ ; }
    return $x ;
}

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
mailto:bernie@fantasyfarm.com     Pearisburg, VA
    -->  Too many people, too few sheep  <--          

==== Want to unsubscribe from this list? (Don't you love us anymore?)
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org