develooper Front page | perl.perl5.porters | Postings from February 2003

[perl #20705] possible error in perl documentation?

From:
Carsten Erdmann
Date:
February 4, 2003 13:10
Subject:
[perl #20705] possible error in perl documentation?
Message ID:
rt-20705-50176.16.4756902351924@bugs6.perl.org
# New Ticket Created by  Carsten Erdmann 
# Please include the string:  [perl #20705]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20705 >


Dear perlbug team,

I hope this is the correct address for error reports in the perl
documentation.

In the documentation for the function "pack" occurs the following statement:

	For example a 4-byte integer
	0x12345678 (305419896 decimal) be ordered
	natively (arranged in and handled by the
	CPU registers) into bytes as

		0x12 0x34 0x56 0x78    # little-endian
		0x78 0x56 0x34 0x12    # big-endian

which seems to be wrong IMHO. As in big-endian architectures the most
significant byte is leftmost, the 4-byte integer 0x12345678 would be stored
in exactly this order on a big-endian machine. So the comments have to be
the other way round: the upper one is big-endian, the lower is
little-endian. I verified this on a (big-endian) HP under HP-UX and a
(little-endian) Intel machine under Linux.

Additionally, the order given above is opposite to the value reported by
$Config{byteorder}.

Best regards,

Carsten




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About