Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How many bytes does Perl use for integers?

Status
Not open for further replies.

inaflash

Programmer
Jun 8, 2000
3
AU
How many bytes does Perl use for standard integers?&nbsp;&nbsp;Could anyone also answer why<br>printf (&quot;%u&quot;, -455); yields 4294966841?<br><br>Thank you
 
An integer is 2^32.&nbsp;&nbsp;The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295. Since %u is unsigned, subtracting 455 from 0 would result in max(unsigned int) - 454 = 4294966841.<br><br>Sincerely,<br><br>Tom Anderson<br>CEO, Order amid Chaos, Inc.<br><A HREF=" TARGET="_new">
 
Is that true for all platforms? (I'm thinking of my 64 bit HPUX box at work - will try it tomorrow)<br><br>Tom - why don't you get a TT userid? <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
It's true for C/C++, which is the basis for Perl.&nbsp;&nbsp;I believe it is the same across all platforms.<br><br>There, I got a userid.&nbsp;&nbsp;It seemed like too much trouble and I didn't really want to get sucked into another forum, but too late. <p> Sincerely,<br><a href=mailto: > </a><br><a href= tanderso@oac-design.com>Tom Anderson</a><br>CEO, Order amid Chaos, Inc.<br>
 
on AiX 4294966841<br>and on HPUX 4294966841<br>same on Win32, looks like same everywhere <p>Mike<br><a href=mailto:michael.j.lacey@ntlworld.com>michael.j.lacey@ntlworld.com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top