Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Power Twool

by jmcnamara (Monsignor)
on Mar 29, 2002 at 16:03 UTC ( #155265=obfuscated: print w/replies, xml ) Need Help??


Calculate the closest power of 2, rounded up, the wrong way. ;-)
#!/usr/bin/perl -l use strict; sub powa2 { ; local %_ = @_ ; keys %_ = pop ; $_ = %_ ; split '\/' ; pop } __END__ print powa2(63); # prints 64 print powa2(64); # prints 64 print powa2(65); # prints 128 print powa2(1234); # prints 2048

--
John.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://155265]
Approved by root
help
Chatterbox?
[1nickt]: If cloudy, one won;t be able to view the coron\a etc., but it will still go dark, I assume?
[1nickt]: I fear S.C. may be overcast but that's where I'll be.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2017-07-20 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (307 votes). Check out past polls.