Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://353267]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-25 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found