Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
"be consistent"
 
PerlMonks  

Re: How to burn 100 megabytes in one line and still get the wrong answer

by tachyon (Chancellor)
on May 14, 2004 at 03:47 UTC ( #353267=note: print w/ replies, xml ) Need Help??


in reply to How to burn 100 megabytes in one line and still get the wrong answer

What is with the 00x ? Perl will be finding the x operator and giving you a string of '0' x BIG_NUM. Does this help?

my $num = 0xffff; my $mask = 0xd0d0; printf " %b (0x%x) %d & %b (0x%x) %d ", $num,$num,$num,$mask,$mask,$mask; print '-' x 31; $num &= $mask; printf " %b (0x%x) %d", $num, $num, $num; __DATA__ 1111111111111111 (0xffff) 65535 & 1101000011010000 (0xd0d0) 53456 ------------------------------- 1101000011010000 (0xd0d0) 53456

cheers

tachyon


Comment on Re: How to burn 100 megabytes in one line and still get the wrong answer
Download Code
Re: Re: How to burn 100 megabytes in one line and still get the wrong answer
by zude (Scribe) on May 14, 2004 at 03:51 UTC
    What is with the 00x ?

    Exactly.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://353267]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (12)
As of 2014-04-18 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (471 votes), past polls