Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Number size equal to one byte

by dada (Chaplain)
on Jul 05, 2002 at 08:41 UTC ( [id://179587]=note: print w/replies, xml ) Need Help??


in reply to Number size equal to one byte

I'm not sure I understand what do you mean, but I'll give it a try.

1.any ideas how to represent the above numbers as one byte.

$number10 = pack('C', 10); # ... $number100 = pack('C', 100);

eg. pack a C char, it's one byte (plus the perl variable overhead itself in memory, as Abigail-II points out).

2. IF number 1 is possible-is there a specific way to measure the size of the number

$size = length($number100);
cheers,
Aldo
__END__ $_=q,just perl,,s, , another ,,s,$, hacker,,print;

Log In?
Username:
Password:

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

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

    No recent polls found